fixed db src a bit
This commit is contained in:
parent
5fb19dd438
commit
0f25833da0
@ -58,7 +58,6 @@ class Download:
|
|||||||
res = Download.fetch_from_src(row, src)
|
res = Download.fetch_from_src(row, src)
|
||||||
if res is not None:
|
if res is not None:
|
||||||
Download.add_url(res, src, id_)
|
Download.add_url(res, src, id_)
|
||||||
break
|
|
||||||
|
|
||||||
logger.warning(f"Didn't find any sources for {row['title']}")
|
logger.warning(f"Didn't find any sources for {row['title']}")
|
||||||
|
|
||||||
|
@ -147,15 +147,15 @@ SELECT DISTINCT
|
|||||||
'source', json_group_array(
|
'source', json_group_array(
|
||||||
(
|
(
|
||||||
SELECT DISTINCT json_object(
|
SELECT DISTINCT json_object(
|
||||||
'src', src_.src,
|
'src', src_table.src,
|
||||||
'url', src_.url,
|
'url', src_table.url,
|
||||||
'valid', src_.valid
|
'valid', src_table.valid
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'id', track.id,
|
'id', track.id,
|
||||||
'tracknumber', track.tracknumber,
|
'tracknumber', track.tracknumber,
|
||||||
'titlesort ', track.tracknumber,
|
'titlesort', track.tracknumber,
|
||||||
'musicbrainz_releasetrackid', track.id,
|
'musicbrainz_releasetrackid', track.id,
|
||||||
'musicbrainz_albumid', release_.id,
|
'musicbrainz_albumid', release_.id,
|
||||||
'title', track.track,
|
'title', track.track,
|
||||||
@ -180,12 +180,12 @@ SELECT DISTINCT
|
|||||||
'src', track.src,
|
'src', track.src,
|
||||||
'lyrics', track.lyrics
|
'lyrics', track.lyrics
|
||||||
)
|
)
|
||||||
FROM track, release_, release_group, artist, artist_track
|
FROM track
|
||||||
LEFT JOIN release_ id ON track.release_id = release_.id
|
LEFT JOIN release_ ON track.release_id = release_.id
|
||||||
LEFT JOIN release_group id ON release_.id = release_group.id
|
LEFT JOIN release_group ON release_.id = release_group.id
|
||||||
LEFT JOIN artist_track track_id ON track.id = artist_track.track_id
|
LEFT JOIN artist_track ON track.id = artist_track.track_id
|
||||||
LEFT JOIN artist id ON artist_track.artist_id = artist.id
|
LEFT JOIN artist ON artist_track.artist_id = artist.id
|
||||||
LEFT JOIN source src_ ON track.id = src_.track_id
|
LEFT JOIN source src_table ON track.id = src_table.track_id
|
||||||
WHERE
|
WHERE
|
||||||
{where_arg}
|
{where_arg}
|
||||||
GROUP BY track.id;
|
GROUP BY track.id;
|
||||||
@ -243,6 +243,10 @@ WHERE '{track_id}' == id;
|
|||||||
self.cursor.execute(query, (url, src))
|
self.cursor.execute(query, (url, src))
|
||||||
self.connection.commit()
|
self.connection.commit()
|
||||||
|
|
||||||
|
query = "INSERT OR REPLACE INTO source (track_id, src, url) VALUES (?, ?, ?);"
|
||||||
|
self.cursor.execute(query, (track_id, src, url))
|
||||||
|
self.connection.commit()
|
||||||
|
|
||||||
def set_filepath(self, track_id: str, file: str, path: str, genre: str):
|
def set_filepath(self, track_id: str, file: str, path: str, genre: str):
|
||||||
query = f"""
|
query = f"""
|
||||||
UPDATE track
|
UPDATE track
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
from music_kraken.__main__ import cli
|
import music_kraken as mk
|
||||||
|
print(mk.__path__)
|
||||||
|
|
||||||
|
# mk.fetch_source.Download()
|
||||||
|
db = mk.utils.shared.database
|
||||||
|
if len(db.get_custom_track([])) == 0:
|
||||||
|
mk.cli()
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
cli()
|
db = mk.utils.shared.database
|
||||||
|
for elem in db.get_custom_track([]):
|
||||||
|
print(elem)
|
||||||
|
print()
|
||||||
|
Loading…
Reference in New Issue
Block a user