From 1488f29e9ff55d4719722839c6a7f131687810f7 Mon Sep 17 00:00:00 2001 From: spl0k Date: Mon, 20 Nov 2017 21:31:10 +0100 Subject: [PATCH] Fixed playlist related errors --- supysonic/managers/user.py | 1 - supysonic/templates/playlist.html | 2 +- supysonic/templates/playlists.html | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) 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 %}