From f477ba1b4fa7eb3bd5396437b81ca0acc254270d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Fri, 4 Dec 2020 09:33:17 +0100 Subject: [PATCH] Podcast search capabilities --- api/funkwhale_api/music/filters.py | 1 + .../changelog.d/podcastssearch.enhancement | 1 + docs/api/parameters.yml | 5 +- docs/swagger.yml | 3 +- front/src/components/Sidebar.vue | 8 +- front/src/components/library/Artists.vue | 5 +- front/src/components/library/Podcasts.vue | 247 ++++++++++ front/src/router/index.js | 17 + front/src/store/ui.js | 5 + front/src/style/components/_sidebar.scss | 437 +++++++++--------- front/src/views/Search.vue | 42 +- 11 files changed, 538 insertions(+), 233 deletions(-) create mode 100644 changes/changelog.d/podcastssearch.enhancement create mode 100644 front/src/components/library/Podcasts.vue diff --git a/api/funkwhale_api/music/filters.py b/api/funkwhale_api/music/filters.py index 60c902815..07e645c4c 100644 --- a/api/funkwhale_api/music/filters.py +++ b/api/funkwhale_api/music/filters.py @@ -103,6 +103,7 @@ class ArtistFilter( playable = filters.BooleanFilter(field_name="_", method="filter_playable") has_albums = filters.BooleanFilter(field_name="_", method="filter_has_albums") tag = TAG_FILTER + content_category = filters.CharFilter("content_category") scope = common_filters.ActorScopeFilter( actor_field="tracks__uploads__library__actor", distinct=True, diff --git a/changes/changelog.d/podcastssearch.enhancement b/changes/changelog.d/podcastssearch.enhancement new file mode 100644 index 000000000..b4937d643 --- /dev/null +++ b/changes/changelog.d/podcastssearch.enhancement @@ -0,0 +1 @@ +Added new search functions to allow users to more easily search for podcasts in the UI. \ No newline at end of file diff --git a/docs/api/parameters.yml b/docs/api/parameters.yml index e5d385d9b..19673271e 100644 --- a/docs/api/parameters.yml +++ b/docs/api/parameters.yml @@ -118,10 +118,9 @@ Scope: - "actor:alice@example.com" - "domain:example.com" -ContentType: - name: "content_type" +ContentCategory: + name: "content_category" in: "query" - default: "all" description: | Limits the results to those whose artist content type matches the query. diff --git a/docs/swagger.yml b/docs/swagger.yml index 5138e61aa..904bd799e 100644 --- a/docs/swagger.yml +++ b/docs/swagger.yml @@ -407,6 +407,7 @@ paths: - $ref: "./api/parameters.yml#/PageSize" - $ref: "./api/parameters.yml#/Related" - $ref: "./api/parameters.yml#/Scope" + - $ref: "./api/parameters.yml#/ContentCategory" responses: 200: content: @@ -505,7 +506,7 @@ paths: - $ref: "./api/parameters.yml#/PageSize" - $ref: "./api/parameters.yml#/Related" - $ref: "./api/parameters.yml#/Scope" - - $ref: "./api/parameters.yml#/ContentType" + - $ref: "./api/parameters.yml#/ContentCategory" responses: 200: diff --git a/front/src/components/Sidebar.vue b/front/src/components/Sidebar.vue index 6ec684f6e..9713c3cdb 100644 --- a/front/src/components/Sidebar.vue +++ b/front/src/components/Sidebar.vue @@ -114,20 +114,22 @@