diff --git a/server/app/api.py b/server/app/api.py index 0795b006..b7fcd92f 100644 --- a/server/app/api.py +++ b/server/app/api.py @@ -13,7 +13,7 @@ all_the_f_music = helpers.getAllSongs() def initialize() -> None: helpers.create_config_dir() - helpers.check_for_new_songs() + # helpers.check_for_new_songs() initialize() @@ -208,7 +208,6 @@ def getFolderTree(folder: str = None): return {"files": helpers.remove_duplicates(songs), "folders": sorted(folders, key=lambda i: i['name'])} - @bp.route('/qwerty') def populateArtists(): all_songs = instances.songs_instance.get_all_songs() @@ -230,7 +229,6 @@ def populateArtists(): return {'songs': artists} - @bp.route('/albums') def getAlbums(): s = instances.songs_instance.get_all_songs() @@ -248,16 +246,14 @@ def getAlbums(): return {'albums': albums} - @bp.route('/albums/') +@cache.cached() def getAlbumSongs(query: str): album = query.split('::')[0].replace('|', '/') artist = query.split('::')[1].replace('|', '/') songs = instances.songs_instance.find_songs_by_album(album, artist) - print(artist) - for song in songs: song['artists'] = song['artists'].split(', ') song['image'] = "http://127.0.0.1:8900/images/thumbnails/" + song['image'] @@ -269,4 +265,5 @@ def getAlbumSongs(query: str): "image": songs[0]['image'], "artist": songs[0]['album_artist'] } - return {'songs': songs, 'info': album_obj} + + return {'songs': helpers.remove_duplicates(songs), 'info': album_obj} diff --git a/server/app/functions.py b/server/app/functions.py index 68849c46..5ff25d32 100644 --- a/server/app/functions.py +++ b/server/app/functions.py @@ -20,8 +20,6 @@ def populate(): ''' files = helpers.run_fast_scandir(helpers.home_dir, [".flac", ".mp3"])[1] - bar = Bar('Indexing files', max=len(files)) - for file in files: file_in_db_obj = instances.songs_instance.find_song_by_path(file) @@ -39,10 +37,6 @@ def populate(): except MutagenError: pass - bar.next() - - bar.finish() - return {'msg': 'updated everything'} diff --git a/server/app/instances.py b/server/app/instances.py index 1a733f10..071fa057 100644 --- a/server/app/instances.py +++ b/server/app/instances.py @@ -3,5 +3,3 @@ from app.models import Artists songs_instance = AllSongs() artist_instance = Artists() - -"" \ No newline at end of file diff --git a/src/components/AlbumView/Header.vue b/src/components/AlbumView/Header.vue index efe4f617..e1b50637 100644 --- a/src/components/AlbumView/Header.vue +++ b/src/components/AlbumView/Header.vue @@ -1,6 +1,5 @@