@@ -6,7 +6,7 @@ export function number_of_migrations() {
66 return migrates . length ;
77}
88
9- const migrates = [ migration_0001 , migration_0002 , migration_0003 , migration_0004 ] ;
9+ const migrates = [ migration_0001 , migration_0002 , migration_0003 , migration_0004 , migration_0005 ] ;
1010
1111export async function migrate ( storage ) {
1212 const storage_iitc_code = await storage . get ( [ 'release_iitc_code' , 'beta_iitc_code' , 'custom_iitc_code' ] ) ;
@@ -25,6 +25,12 @@ export async function migrate(storage) {
2525 'local_plugins_user' ,
2626 ] ) ;
2727 const storage_misc = await storage . get ( [ 'channel' , 'network_host' , 'lastversion' , 'storage_version' ] ) ;
28+ const update_check_interval = await storage . get ( [
29+ 'release_update_check_interval' ,
30+ 'beta_update_check_interval' ,
31+ 'custom_update_check_interval' ,
32+ 'external_update_check_interval' ,
33+ ] ) ;
2834
2935 if ( ! isSet ( storage_misc [ 'storage_version' ] ) && isSet ( storage_misc [ 'lastversion' ] ) ) {
3036 storage_misc [ 'storage_version' ] = 0 ;
@@ -34,13 +40,13 @@ export async function migrate(storage) {
3440 for ( const migrate of migrates ) {
3541 const index = migrates . indexOf ( migrate ) ;
3642 if ( parseInt ( storage_misc [ 'storage_version' ] ) < index + 1 ) {
37- await migrate ( storage_iitc_code , storage_plugins_flat , storage_plugins_user , storage_misc ) ;
43+ await migrate ( storage_iitc_code , storage_plugins_flat , storage_plugins_user , storage_misc , update_check_interval ) ;
3844 is_migrated = true ;
3945 }
4046 }
4147
4248 storage_misc [ 'storage_version' ] = migrates . length ;
43- await storage . set ( { ...storage_iitc_code , ...storage_plugins_flat , ...storage_plugins_user , ...storage_misc } ) ;
49+ await storage . set ( { ...storage_iitc_code , ...storage_plugins_flat , ...storage_plugins_user , ...storage_misc , ... update_check_interval } ) ;
4450 return is_migrated ;
4551}
4652
@@ -96,3 +102,16 @@ async function migration_0004(storage_iitc_code) {
96102 }
97103 }
98104}
105+
106+ async function migration_0005 ( storage_iitc_code , storage_plugins_flat , storage_plugins_user , storage_misc , update_check_interval ) {
107+ for ( let channel of Object . keys ( update_check_interval ) ) {
108+ const interval = update_check_interval [ channel ] ;
109+ if ( ! isSet ( interval ) ) {
110+ delete update_check_interval [ channel ] ;
111+ continue ;
112+ }
113+ if ( interval !== 24 * 60 * 60 ) {
114+ update_check_interval [ channel ] = interval * 60 * 60 ;
115+ }
116+ }
117+ }
0 commit comments