diff --git a/supysonic/managers/user.py b/supysonic/managers/user.py index 8643d2e..e9042c1 100644 --- a/supysonic/managers/user.py +++ b/supysonic/managers/user.py @@ -76,7 +76,6 @@ class UserManager: store.find(RatingTrack, RatingTrack.user_id == user.id).remove() store.find(ChatMessage, ChatMessage.user_id == user.id).remove() for playlist in store.find(Playlist, Playlist.user_id == user.id): - playlist.tracks.clear() store.remove(playlist) store.remove(user) diff --git a/supysonic/templates/playlist.html b/supysonic/templates/playlist.html index f9d22f4..84c0f2e 100644 --- a/supysonic/templates/playlist.html +++ b/supysonic/templates/playlist.html @@ -39,7 +39,7 @@ ArtistTitleAlbumLength - {% for t in playlist.tracks %} + {% for t in playlist.get_tracks() %} {{ t.album.artist.name }}{{ t.title }}{{ t.album.name }}{{ t.duration_str() }} {% endfor %} diff --git a/supysonic/templates/playlists.html b/supysonic/templates/playlists.html index b3f6cc9..31314ed 100644 --- a/supysonic/templates/playlists.html +++ b/supysonic/templates/playlists.html @@ -27,7 +27,7 @@ {% for p in mine %} {{ p.name }} - {{ p.tracks.count() }} + {{ p.get_tracks()|length }} {% if p.public %}{% else %} {{ p.name }} {{ p.user.name }} - {{ p.tracks.count() }} + {{ p.get_tracks()|length }} {% endfor %}