@@ -2,11 +2,8 @@ import ProviderUtils from '../../generic/ProviderUtils';
2
2
import ThunderstoreVersion from '../../../model/ThunderstoreVersion' ;
3
3
import ThunderstoreMod from '../../../model/ThunderstoreMod' ;
4
4
import ThunderstoreCombo from '../../../model/ThunderstoreCombo' ;
5
- import ManifestV2 from '../../../model/ManifestV2' ;
6
5
import R2Error from '../../../model/errors/R2Error' ;
7
6
import ExportMod from '../../../model/exports/ExportMod' ;
8
- import ManagerSettings from '../../../r2mm/manager/ManagerSettings' ;
9
- import Game from '../../../model/game/Game' ;
10
7
import Profile from '../../../model/Profile' ;
11
8
12
9
export default abstract class ThunderstoreDownloaderProvider {
@@ -48,39 +45,40 @@ export default abstract class ThunderstoreDownloaderProvider {
48
45
/**
49
46
* A top-level method to download the latest version of all mods passed in, including their dependencies.
50
47
*
51
- * @param game Currently selected game
52
48
* @param modsWithUpdate An array of ThunderstoreCombo objects to be updated.
53
49
* @param allMods An array of all mods available from the Thunderstore API.
50
+ * @param ignoreCache Download mod even if it already exists in the cache.
54
51
* @param callback Callback to show the current state of the downloads.
55
52
* @param completedCallback Callback to perform final actions against. Only called if {@param callback} has not returned a failed status.
56
53
*/
57
- public abstract downloadLatestOfAll ( game : Game , modsWithUpdate : ThunderstoreCombo [ ] , allMods : ThunderstoreMod [ ] ,
54
+ public abstract downloadLatestOfAll ( modsWithUpdate : ThunderstoreCombo [ ] , allMods : ThunderstoreMod [ ] , ignoreCache : boolean ,
58
55
callback : ( progress : number , modName : string , status : number , err : R2Error | null ) => void ,
59
56
completedCallback : ( modList : ThunderstoreCombo [ ] ) => void ) : void ;
60
57
61
58
/**
62
59
* A top-level method to download the latest version of a mod including its dependencies.
63
60
*
64
- * @param game Currently selected game
65
61
* @param mod The mod to be downloaded.
66
62
* @param modVersion The version of the mod to download.
67
63
* @param allMods An array of all mods available from the Thunderstore API.
64
+ * @param ignoreCache Download mod even if it already exists in the cache.
68
65
* @param callback Callback to show the current state of the downloads.
69
66
* @param completedCallback Callback to perform final actions against. Only called if {@param callback} has not returned a failed status.
70
67
*/
71
- public abstract download ( game : Game , profile : Profile , mod : ThunderstoreMod , modVersion : ThunderstoreVersion , allMods : ThunderstoreMod [ ] ,
68
+ public abstract download ( profile : Profile , mod : ThunderstoreMod , modVersion : ThunderstoreVersion , allMods : ThunderstoreMod [ ] , ignoreCache : boolean ,
72
69
callback : ( progress : number , modName : string , status : number , err : R2Error | null ) => void ,
73
70
completedCallback : ( modList : ThunderstoreCombo [ ] ) => void ) : void ;
74
71
75
72
/**
76
73
* A top-level method to download exact versions of exported mods.
77
74
*
78
- * @param game Currently selected game
79
75
* @param modList An array of {@class ExportMod} mods to download.
76
+ * @param allMods An array of all mods available from the Thunderstore API.
77
+ * @param ignoreCache Download mod even if it already exists in the cache.
80
78
* @param callback See {@method download}.
81
79
* @param completedCallback See {@method download}
82
80
*/
83
- public abstract downloadImportedMods ( game : Game , modList : ExportMod [ ] ,
81
+ public abstract downloadImportedMods ( modList : ExportMod [ ] , allMods : ThunderstoreMod [ ] , ignoreCache : boolean ,
84
82
callback : ( progress : number , modName : string , status : number , err : R2Error | null ) => void ,
85
83
completedCallback : ( mods : ThunderstoreCombo [ ] ) => void ) : void ;
86
84
@@ -97,28 +95,27 @@ export default abstract class ThunderstoreDownloaderProvider {
97
95
* Iterate the {@class ThunderstoreCombo} array to perform the download for each mod.
98
96
* Progress to the next one recursively once the callback received has been successful.
99
97
*
100
- * @param settings Instance of ManagerSettings .
101
- * @param entries IterableIterator of entries for { @class ThunderstoreCombo} mods to download.
102
- * @param callback See {@method download}
98
+ * @param entries IterableIterator of entries for { @class ThunderstoreCombo} mods to download .
99
+ * @param ignoreCache Should mod be downloaded even if it already exists in the cache?
100
+ * @param callback See {@method download}
103
101
*/
104
- public abstract queueDownloadDependencies ( settings : ManagerSettings , entries : IterableIterator < [ number , ThunderstoreCombo ] > , callback : ( progress : number , modName : string , status : number , err : R2Error | null ) => void ) : void
102
+ public abstract queueDownloadDependencies ( entries : IterableIterator < [ number , ThunderstoreCombo ] > , ignoreCache : boolean , callback : ( progress : number , modName : string , status : number , err : R2Error | null ) => void ) : void
105
103
106
104
/**
107
105
* Generate the total count of mods to be downloaded. Cached mods are not included in this count unless download cache is disabled.
108
106
*
109
- * @param settings Instance of ManagerSettings.
110
107
* @param list List of mods generated by a dependency building method including the primary mod to be downloaded.
111
108
*/
112
- public abstract calculateInitialDownloadSize ( settings : ManagerSettings , list : ThunderstoreCombo [ ] ) : number ;
109
+ public abstract calculateInitialDownloadSize ( list : ThunderstoreCombo [ ] ) : number ;
113
110
114
111
/**
115
112
* Perform the download of the given {@class ThunderstoreCombo}.
116
113
*
117
- * @param combo The current mod to download.
118
- * @param settings Instance of ManagerSettings.
119
- * @param callback See {@method download}
114
+ * @param combo The current mod to download.
115
+ * @param ignoreCache Should mod be downloaded even if it already exists in the cache?
116
+ * @param callback See {@method download}
120
117
*/
121
- public abstract downloadAndSave ( combo : ThunderstoreCombo , settings : ManagerSettings , callback : ( progress : number , status : number , err : R2Error | null ) => void ) : void ;
118
+ public abstract downloadAndSave ( combo : ThunderstoreCombo , ignoreCache : boolean , callback : ( progress : number , status : number , err : R2Error | null ) => void ) : void ;
122
119
123
120
/**
124
121
* Save the download buffer to a zip file in the cache.
0 commit comments