You've already forked RadioPlayer
mirror of
https://github.com/radio95-rnt/RadioPlayer.git
synced 2026-02-27 14:13:55 +01:00
get rid of quiet reloads
This commit is contained in:
@@ -98,16 +98,15 @@ class Module(PlaylistAdvisor):
|
||||
self.last_mod_time = Time.get_playlist_modification_time(night_playlist)
|
||||
self.last_playlist = night_playlist
|
||||
return night_playlist
|
||||
def new_playlist(self) -> int:
|
||||
if self.custom_playlist: return 0
|
||||
if not self.last_playlist: return 1
|
||||
time_change = check_if_playlist_modifed(self.last_playlist)
|
||||
if time_change: return 2
|
||||
def new_playlist(self) -> bool:
|
||||
if self.custom_playlist: return False
|
||||
if not self.last_playlist: return True
|
||||
if check_if_playlist_modifed(self.last_playlist): return True
|
||||
mod_time = Time.get_playlist_modification_time(self.last_playlist)
|
||||
if mod_time > self.last_mod_time:
|
||||
logger.info("Playlist changed on disc, reloading...")
|
||||
return 1
|
||||
return 0
|
||||
return True
|
||||
return False
|
||||
def imc(self, imc: InterModuleCommunication):
|
||||
self.class_imc = imc
|
||||
imc.register(self, "advisor")
|
||||
|
||||
Reference in New Issue
Block a user