mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 13:03:02 +00:00
Save complete tracks and albums to the db for faster startup
- refactor function locations - add logger - check for new tracks instead of re-processing all files
This commit is contained in:
@@ -53,7 +53,7 @@ class Album:
|
||||
Album class
|
||||
"""
|
||||
|
||||
album: str
|
||||
title: str
|
||||
artist: str
|
||||
count: int
|
||||
duration: int
|
||||
@@ -62,20 +62,22 @@ class Album:
|
||||
image: str
|
||||
|
||||
def __init__(self, tags):
|
||||
self.album = tags["album"]
|
||||
self.title = tags["album"]
|
||||
self.artist = tags["artist"]
|
||||
self.count = tags["count"]
|
||||
self.duration = tags["duration"]
|
||||
self.date = tags["date"]
|
||||
self.artistimage = settings.IMG_ARTIST_URI + tags["artistimage"]
|
||||
self.image = settings.IMG_THUMB_URI + tags["image"]
|
||||
self.artistimage = tags["artistimage"]
|
||||
self.image = tags["image"]
|
||||
|
||||
|
||||
def get_p_track(ptrack):
|
||||
for track in api.TRACKS:
|
||||
if (track.title == ptrack["title"]
|
||||
and track.artists == ptrack["artists"]
|
||||
and ptrack["album"] == track.album):
|
||||
if (
|
||||
track.title == ptrack["title"]
|
||||
and track.artists == ptrack["artists"]
|
||||
and ptrack["album"] == track.album
|
||||
):
|
||||
return track
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user