This commit is contained in:
mungai-njoroge
2023-07-29 07:00:31 +03:00
parent 93de3d2f0c
commit 50aa971972
6 changed files with 6 additions and 4 deletions
+1
View File
@@ -177,6 +177,7 @@ def get_playlist(playlistid: str):
playlist.last_updated = date_string_to_time_passed(playlist.last_updated) playlist.last_updated = date_string_to_time_passed(playlist.last_updated)
playlist.set_duration(duration) playlist.set_duration(duration)
playlist.set_count(len(tracks))
if not playlist.has_image: if not playlist.has_image:
playlist.images = get_first_4_images(tracks) playlist.images = get_first_4_images(tracks)
-2
View File
@@ -2,7 +2,6 @@
Helper functions for use with the SQLite database. Helper functions for use with the SQLite database.
""" """
from pprint import pprint
import sqlite3 import sqlite3
from sqlite3 import Connection, Cursor from sqlite3 import Connection, Cursor
import time import time
@@ -46,7 +45,6 @@ def tuple_to_playlist(playlist: tuple):
""" """
Takes a tuple and returns a Playlist object Takes a tuple and returns a Playlist object
""" """
pprint(playlist)
return Playlist(*playlist) return Playlist(*playlist)
+1 -1
View File
@@ -41,5 +41,5 @@ def apply_migrations():
log.info("Running new migration: %s", m.name) log.info("Running new migration: %s", m.name)
m.migrate() m.migrate()
# update migration version # bump migration version
MigrationManager.set_version(len(migrations)) MigrationManager.set_version(len(migrations))
+1
View File
@@ -110,6 +110,7 @@ class AddSettingsToPlaylistTable:
# (my first coroutine) # (my first coroutine)
pipeline = insert_playlist() pipeline = insert_playlist()
transform_playlists(pipeline, playlists) transform_playlists(pipeline, playlists)
pipeline.close()
cur.close() cur.close()
+3
View File
@@ -44,6 +44,9 @@ class Playlist:
def set_duration(self, duration: int): def set_duration(self, duration: int):
self.duration = duration self.duration = duration
def set_count(self, count: int):
self.count = count
def clear_lists(self): def clear_lists(self):
""" """
-1
View File
@@ -1,7 +1,6 @@
""" """
Requests related to artists Requests related to artists
""" """
from pprint import pprint
import requests import requests
from app import settings from app import settings