From 02ac2df31a7f3ce5d28d9c4dba0059d0c8ffce23 Mon Sep 17 00:00:00 2001 From: spl0k Date: Mon, 14 Nov 2016 19:29:09 +0100 Subject: [PATCH] Missing imports Fixes #53 --- supysonic/managers/folder.py | 2 +- supysonic/managers/user.py | 4 +++- supysonic/scanner.py | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/supysonic/managers/folder.py b/supysonic/managers/folder.py index 51206d7..c138403 100644 --- a/supysonic/managers/folder.py +++ b/supysonic/managers/folder.py @@ -19,7 +19,7 @@ # along with this program. If not, see . import os.path, uuid -from supysonic.db import Folder, Artist, Album, Track +from supysonic.db import Folder, Artist, Album, Track, StarredFolder, RatingFolder from supysonic.scanner import Scanner class FolderManager: diff --git a/supysonic/managers/user.py b/supysonic/managers/user.py index 8e7821a..211dfa1 100644 --- a/supysonic/managers/user.py +++ b/supysonic/managers/user.py @@ -21,7 +21,9 @@ import string, random, hashlib import uuid -from supysonic.db import User +from supysonic.db import User, ChatMessage, Playlist +from supysonic.db import StarredFolder, StarredArtist, StarredAlbum, StarredTrack +from supysonic.db import RatingFolder, RatingTrack class UserManager: SUCCESS = 0 diff --git a/supysonic/scanner.py b/supysonic/scanner.py index 7545331..783ae31 100644 --- a/supysonic/scanner.py +++ b/supysonic/scanner.py @@ -26,7 +26,9 @@ from storm.expr import ComparableExpr, compile, Like from storm.exceptions import NotSupportedError from supysonic import config -from supysonic.db import Folder, Artist, Album, Track +from supysonic.db import Folder, Artist, Album, Track, User, PlaylistTrack +from supysonic.db import StarredFolder, StarredArtist, StarredAlbum, StarredTrack +from supysonic.db import RatingFolder, RatingTrack def get_mime(ext): return mimetypes.guess_type('dummy.' + ext, False)[0] or config.get('mimetypes', ext) or 'application/octet-stream' @@ -203,7 +205,7 @@ class Scanner: self.__store.find(StarredTrack, StarredTrack.starred_id == tr.id).remove() self.__store.find(RatingTrack, RatingTrack.rated_id == tr.id).remove() self.__store.find(PlaylistTrack, PlaylistTrack.track_id == tr.id).remove() - self.__store.find(User, User.last_play_id == tr.id).set(User.last_play_id = None) + self.__store.find(User, User.last_play_id == tr.id).set(last_play_id = None) self.__folders_to_check.add(tr.folder) self.__albums_to_check.add(tr.album)