From 0305b3d59420004153b781ce620a67fa3894f865 Mon Sep 17 00:00:00 2001 From: dashwav Date: Sat, 12 Aug 2017 23:54:21 -0700 Subject: [PATCH 1/7] standardized url fields --- minoshiro/web_api/ani_list.py | 2 ++ minoshiro/web_api/kitsu.py | 4 ++++ minoshiro/web_api/mal.py | 2 ++ 3 files changed, 8 insertions(+) diff --git a/minoshiro/web_api/ani_list.py b/minoshiro/web_api/ani_list.py index 254417b..9b30dd8 100644 --- a/minoshiro/web_api/ani_list.py +++ b/minoshiro/web_api/ani_list.py @@ -179,6 +179,7 @@ async def get_page_by_popularity(session_manager, medium: Medium, }} synonyms id + url: siteUrl type format }} @@ -213,6 +214,7 @@ def __get_query_string(medium, query, search=False) -> str: english native }} + url: siteUrl startDate {{ year month diff --git a/minoshiro/web_api/kitsu.py b/minoshiro/web_api/kitsu.py index 8468496..80b24d3 100644 --- a/minoshiro/web_api/kitsu.py +++ b/minoshiro/web_api/kitsu.py @@ -110,6 +110,8 @@ async def search_entries(self, medium: Medium, ) if js: closest_entry = get_closest(query, js['data']) + if closest_entry: + closest_entry['url'] = closest_entry['links']['self'] return closest_entry async def get_entry_by_id(self, medium, id_, timeout=3) -> Optional[dict]: @@ -137,4 +139,6 @@ async def get_entry_by_id(self, medium, id_, timeout=3) -> Optional[dict]: ) first = js['data'] + if first[0]: + first[0]['url'] = first[0]['links']['self'] return first.pop() diff --git a/minoshiro/web_api/mal.py b/minoshiro/web_api/mal.py index 5ddd060..1f05c4f 100644 --- a/minoshiro/web_api/mal.py +++ b/minoshiro/web_api/mal.py @@ -48,6 +48,7 @@ async def get_entry_details(session_manager, header_info: dict, if medium == Medium.ANIME: data = { 'id': thing.find('id').text, + 'url': f'https://myanimelist.net/anime/{thing.find("id").text}', 'title': thing.find('title').text, 'english': thing.find('english').text, 'synonyms': synonyms, @@ -62,6 +63,7 @@ async def get_entry_details(session_manager, header_info: dict, else: data = { 'id': thing.find('id').text, + 'url': f'https://myanimelist.net/manga/{thing.find("id").text}', 'title': thing.find('title').text, 'english': thing.find('english').text, 'synonyms': synonyms, From e81ccd17710036f086f40f6164cdae4eeceac749 Mon Sep 17 00:00:00 2001 From: dashwav Date: Sat, 12 Aug 2017 23:55:11 -0700 Subject: [PATCH 2/7] Update .version --- .version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.version b/.version index d917d3e..b1e80bb 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -0.1.2 +0.1.3 From 1ec7f24ec465f1ef69e96d401aa07378d9a4a6da Mon Sep 17 00:00:00 2001 From: dashwav Date: Sun, 13 Aug 2017 00:47:49 -0700 Subject: [PATCH 3/7] Update mal.py --- minoshiro/web_api/mal.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/minoshiro/web_api/mal.py b/minoshiro/web_api/mal.py index 1f05c4f..b3c80e0 100644 --- a/minoshiro/web_api/mal.py +++ b/minoshiro/web_api/mal.py @@ -48,7 +48,8 @@ async def get_entry_details(session_manager, header_info: dict, if medium == Medium.ANIME: data = { 'id': thing.find('id').text, - 'url': f'https://myanimelist.net/anime/{thing.find("id").text}', + 'url': 'https://myanimelist.net/anime/' + f'{thing.find("id").text}', 'title': thing.find('title').text, 'english': thing.find('english').text, 'synonyms': synonyms, @@ -63,7 +64,8 @@ async def get_entry_details(session_manager, header_info: dict, else: data = { 'id': thing.find('id').text, - 'url': f'https://myanimelist.net/manga/{thing.find("id").text}', + 'url': 'https://myanimelist.net/manga/' + f'{thing.find("id").text}', 'title': thing.find('title').text, 'english': thing.find('english').text, 'synonyms': synonyms, From 999c8ea71f9ce62aa58abe169462ac5116ac852a Mon Sep 17 00:00:00 2001 From: dashwav Date: Sun, 13 Aug 2017 00:58:17 -0700 Subject: [PATCH 4/7] Update .version --- .version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.version b/.version index b1e80bb..845639e 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -0.1.3 +0.1.4 From 7a9fe003ecb870ae8f71f2acb305a7963be97855 Mon Sep 17 00:00:00 2001 From: dashwav Date: Sun, 13 Aug 2017 10:01:23 -0700 Subject: [PATCH 5/7] Update .version --- .version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.version b/.version index 845639e..b1e80bb 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -0.1.4 +0.1.3 From 24469a24db17c3b37533a4e8ef3ab46fc085833c Mon Sep 17 00:00:00 2001 From: dashwav Date: Sun, 13 Aug 2017 16:35:06 -0700 Subject: [PATCH 6/7] fixed more standardization issues --- minoshiro/minoshiro.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/minoshiro/minoshiro.py b/minoshiro/minoshiro.py index 9065d75..eabba3c 100644 --- a/minoshiro/minoshiro.py +++ b/minoshiro/minoshiro.py @@ -566,9 +566,9 @@ async def __find_manga_updates(self, cached_ids, medium, mu_id )}, None else: - return {'url': await mu.get_manga_url( + return await mu.get_manga_url( self.session_manager, query, names, timeout - )}, None + ), None return None, None @@ -592,8 +592,8 @@ async def __find_lndb(self, cached_ids, medium, query, names, timeout): lndb_id )}, None else: - return {'url': await lndb.get_light_novel_url( - self.session_manager, query, names, timeout)}, None + return await lndb.get_light_novel_url( + self.session_manager, query, names, timeout), None return None, None async def __find_novel_updates(self, cached_ids, medium, @@ -616,9 +616,9 @@ async def __find_novel_updates(self, cached_ids, medium, return {'url': nu.get_light_novel_by_id( nu_id )}, None - return {'url': await nu.get_light_novel_url( + return await nu.get_light_novel_url( self.session_manager, query, names, timeout - )}, None + ), None return None, None From 1f8f3255a2ca75fe2e452b41fdc9c252700de914 Mon Sep 17 00:00:00 2001 From: dashwav Date: Sun, 13 Aug 2017 16:36:58 -0700 Subject: [PATCH 7/7] Update .version hopefully this is the final version change for a while --- .version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.version b/.version index b1e80bb..845639e 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -0.1.3 +0.1.4