fda
This commit is contained in:
parent
37c8d894aa
commit
cbb56499bf
27
src/goof.py
27
src/goof.py
@ -1,21 +1,32 @@
|
|||||||
import music_kraken
|
import music_kraken
|
||||||
|
from music_kraken import (
|
||||||
|
Song,
|
||||||
|
Lyrics,
|
||||||
|
Target,
|
||||||
|
Source
|
||||||
|
)
|
||||||
|
|
||||||
import music_kraken.database.new_database as db
|
import music_kraken.database.new_database as db
|
||||||
|
|
||||||
cache = music_kraken.database.new_database.Database("test.db")
|
cache = music_kraken.database.new_database.Database("test.db")
|
||||||
cache.reset()
|
cache.reset()
|
||||||
|
|
||||||
artist = music_kraken.Artist(
|
song = Song(
|
||||||
name="I'm in a Coffin"
|
|
||||||
)
|
|
||||||
|
|
||||||
song = music_kraken.Song(
|
|
||||||
title="Vein Deep in the Solution",
|
title="Vein Deep in the Solution",
|
||||||
release="One Final Action",
|
release_name="One Final Action",
|
||||||
artists=[artist]
|
target=Target(file="~/Music/genre/artist/album/song.mp3", path="~/Music/genre/artist/album"),
|
||||||
|
metadata={
|
||||||
|
"album": "One Final Action"
|
||||||
|
},
|
||||||
|
lyrics=[
|
||||||
|
Lyrics(text="these are some depressive lyrics", language="en")
|
||||||
|
],
|
||||||
|
sources=[
|
||||||
|
Source(src="youtube", url="https://youtu.be/dfnsdajlhkjhsd")
|
||||||
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
cache.push([artist, song])
|
cache.push([song])
|
||||||
|
|
||||||
"""
|
"""
|
||||||
music_kraken.clear_cache()
|
music_kraken.clear_cache()
|
||||||
|
@ -17,7 +17,7 @@ from .utils.shared import (
|
|||||||
NOT_A_GENRE
|
NOT_A_GENRE
|
||||||
)
|
)
|
||||||
|
|
||||||
from .lyrics import lyrics
|
# from .lyrics import lyrics
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@ -40,10 +40,13 @@ musicbrainzngs.set_useragent("metadata receiver", "0.1", "https://github.com/HeI
|
|||||||
# define the most important values and function for import in the __init__ file
|
# define the most important values and function for import in the __init__ file
|
||||||
Song = database.Song
|
Song = database.Song
|
||||||
Artist = database.Artist
|
Artist = database.Artist
|
||||||
|
Source = database.Source
|
||||||
|
Target = database.Target
|
||||||
|
Lyrics = database.Lyrics
|
||||||
MetadataSearch = metadata.MetadataSearch
|
MetadataSearch = metadata.MetadataSearch
|
||||||
MetadataDownload = metadata.MetadataDownload
|
MetadataDownload = metadata.MetadataDownload
|
||||||
|
|
||||||
cache = database.cache
|
# cache = database.cache
|
||||||
|
|
||||||
|
|
||||||
def fetch_metadata(type_: str, id_: str):
|
def fetch_metadata(type_: str, id_: str):
|
||||||
|
@ -10,4 +10,4 @@ Target = objects.Target
|
|||||||
Metadata = objects.Metadata
|
Metadata = objects.Metadata
|
||||||
Lyrics = objects.Lyrics
|
Lyrics = objects.Lyrics
|
||||||
|
|
||||||
cache = temp_database.TempDatabase()
|
# cache = temp_database.TempDatabase()
|
||||||
|
@ -4,7 +4,7 @@ import logging
|
|||||||
from typing import List
|
from typing import List
|
||||||
from pkg_resources import resource_string
|
from pkg_resources import resource_string
|
||||||
|
|
||||||
from .song import (
|
from .objects import (
|
||||||
Song,
|
Song,
|
||||||
Lyrics,
|
Lyrics,
|
||||||
Metadata,
|
Metadata,
|
||||||
@ -74,7 +74,22 @@ class Database:
|
|||||||
self.push_one(db_object)
|
self.push_one(db_object)
|
||||||
|
|
||||||
def push_song(self, song: Song):
|
def push_song(self, song: Song):
|
||||||
pass
|
# ADDING THE DATA FOR THE SONG OBJECT
|
||||||
|
"""
|
||||||
|
db_field - object attribute
|
||||||
|
-------------------------------
|
||||||
|
id - id
|
||||||
|
name - title
|
||||||
|
"""
|
||||||
|
table = "Song"
|
||||||
|
query = f"INSERT OR REPLACE INTO {table} (id, name) VALUES (?, ?);"
|
||||||
|
values = (
|
||||||
|
song.id,
|
||||||
|
song.title
|
||||||
|
)
|
||||||
|
|
||||||
|
self.cursor.execute(query, values)
|
||||||
|
self.connection.commit()
|
||||||
|
|
||||||
def push_lyrics(self, lyrics: Lyrics):
|
def push_lyrics(self, lyrics: Lyrics):
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user