mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
cleanrup
This commit is contained in:
@@ -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,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)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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))
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|
||||||
|
|||||||
@@ -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,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
|
||||||
|
|||||||
Reference in New Issue
Block a user