def read(): path = TokenSettings.__getFilePath__() txt = getContent(path) if txt == "": return TokenSettings() txt = __decode__(txt) data = json.loads(txt) ret = dictToModel(data, TokenSettings()) return ret
def read(): path = Settings.__getFilePath__() txt = getContent(path) if txt == "": return Settings() data = json.loads(txt) ret = dictToModel(data, Settings()) ret.audioQuality = Settings.getAudioQuality(ret.audioQuality) ret.videoQuality = Settings.getVideoQuality(ret.videoQuality) ret.usePlaylistFolder = ret.usePlaylistFolder == True or ret.usePlaylistFolder is None ret.multiThreadDownload = ret.multiThreadDownload == True or ret.multiThreadDownload is None if ret.albumFolderFormat is None: ret.albumFolderFormat = Settings.getDefaultAlbumFolderFormat() if ret.trackFileFormat is None: ret.trackFileFormat = Settings.getDefaultTrackFileFormat() return ret