diff options
author | Eddy Pedroni <epedroni@pm.me> | 2024-11-09 20:35:56 +0100 |
---|---|---|
committer | Eddy Pedroni <epedroni@pm.me> | 2024-11-09 20:35:56 +0100 |
commit | cda8197669409689be291660f93cb288ab2d31b3 (patch) | |
tree | 81db9b0c7c0491e0737cbffb39af6b935c0dfeb8 /session_manager.py | |
parent | a2257a900d4fffd6f94b73f1c48c62370ed1d684 (diff) |
Migrate to project-based structure
Diffstat (limited to 'session_manager.py')
-rw-r--r-- | session_manager.py | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/session_manager.py b/session_manager.py deleted file mode 100644 index 718e864..0000000 --- a/session_manager.py +++ /dev/null @@ -1,41 +0,0 @@ -import json - -class SessionManager: - def __init__(self, playlist, abController): - self._playlist = playlist - self._abController = abController - - def addSong(self, path): - self._playlist.addSong(path) - - def storeLimits(self, aLimit, bLimit): - self._abController.storeLimits(aLimit, bLimit) - - def loadSession(self, file): - jsonStr = file.read() - session = json.loads(jsonStr) - - self._playlist.clear() - self._abController.clear() - - for entry in session: - songPath = entry["path"] - abLimits = entry["ab_limits"] - self._playlist.addSong(songPath) - - if abLimits is not None: - for l in abLimits: - self._abController.storeLimits(l[0], l[1], songPath) - - def saveSession(self, file): - songs = self._playlist.getSongs() - session = list() - - for s in songs: - entry = { - "path": s, - "ab_limits" : self._abController.getStoredLimits(s) - } - session.append(entry) - - file.write(json.dumps(session)) |