From 5dcc8451bf127f3c34181a135b35134f0a7c5e6a Mon Sep 17 00:00:00 2001 From: Sander Vocke Date: Fri, 28 Aug 2020 12:08:09 +0200 Subject: [PATCH] Some warning cleanup. --- client/src/App.tsx | 2 +- client/src/components/QueryBrowseWindow.tsx | 2 +- scripts/gpm_retrieve/gpm_retrieve.py | 8 ++++---- server/endpoints/QueryEndpointHandler.ts | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index 03e5815..e6cb8dc 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -80,7 +80,7 @@ function AppBody() { pushQuery(fq, fo, ft); return; } - }); + }, [ itemOrder, itemQuery, itemTypes ]); const onAppBarTabChange = (value: AppBarActiveTab) => { switch (value) { diff --git a/client/src/components/QueryBrowseWindow.tsx b/client/src/components/QueryBrowseWindow.tsx index f9766da..ebc0604 100644 --- a/client/src/components/QueryBrowseWindow.tsx +++ b/client/src/components/QueryBrowseWindow.tsx @@ -166,7 +166,7 @@ export default function QueryBrowseWindow(props: IProps) { 'songs' in json && match && setSongs(json.songs); 'artists' in json && match && setArtists(json.artists); }); - }); + }, [ props.query, props.resultOrder, props.typesIncluded ]); return <> diff --git a/scripts/gpm_retrieve/gpm_retrieve.py b/scripts/gpm_retrieve/gpm_retrieve.py index 9d6806c..c20a02d 100755 --- a/scripts/gpm_retrieve/gpm_retrieve.py +++ b/scripts/gpm_retrieve/gpm_retrieve.py @@ -108,13 +108,13 @@ def uploadLibrary(mudbase_api, songs): tagIds.append(genreTagId) _song = { 'title': song['title'], - 'artistIds': [ artistId ] if artistId else [], - 'albumIds': [ albumId ] if albumId else [], + 'artistIds': [ artistId ] if artistId != None else [], + 'albumIds': [ albumId ] if albumId != None else [], 'tagIds': tagIds, 'storeLinks': [ 'https://play.google.com/music/m/' + id for id in getSongStoreIds(song) ], } - response = requests.post(mudbase_api + '/song', json = song).json() - print(f"Created song \"{song['title']}\" with artist ID {artistId}, response: {response}") + response = requests.post(mudbase_api + '/song', json = _song).json() + print(f"Created song \"{song['title']}\" with artist ID {artistId}, album ID {albumId}, response: {response}") def getData(api): return { diff --git a/server/endpoints/QueryEndpointHandler.ts b/server/endpoints/QueryEndpointHandler.ts index 041e088..c819cf9 100644 --- a/server/endpoints/QueryEndpointHandler.ts +++ b/server/endpoints/QueryEndpointHandler.ts @@ -114,7 +114,7 @@ export const QueryEndpointHandler: EndpointHandler = async (req: any, res: any) // Custom pagination is implemented before responding. where: getSequelizeWhere(reqObject.query, QueryType.Song), order: getSequelizeOrder(reqObject.ordering, QueryType.Song), - include: [models.Artist, models.Album, models.Tag, models.Ranking], + include: [ models.Artist, models.Album, models.Tag, models.Ranking ], //limit: reqObject.limit, //offset: reqObject.offset, })