diff --git a/api/funkwhale_api/music/filters.py b/api/funkwhale_api/music/filters.py index f38b4d9cd46572937b346f3f69303bfdc9ac0cc6..60c902815524d404da0842d3e08284d4dfde90ee 100644 --- a/api/funkwhale_api/music/filters.py +++ b/api/funkwhale_api/music/filters.py @@ -257,6 +257,7 @@ class AlbumFilter( search_fields=["title", "artist__name"], fts_search_fields=["body_text", "artist__body_text"], ) + content_category = filters.CharFilter("artist__content_category") tag = TAG_FILTER scope = common_filters.ActorScopeFilter( actor_field="tracks__uploads__library__actor", diff --git a/changes/changelog.d/1300.bugfix b/changes/changelog.d/1300.bugfix new file mode 100644 index 0000000000000000000000000000000000000000..a993171c659dad8a628a785630610f53f0c99bd9 --- /dev/null +++ b/changes/changelog.d/1300.bugfix @@ -0,0 +1 @@ +Fixed an issue where channel albums don't show up in the album search (#1300) \ No newline at end of file diff --git a/docs/api/definitions.yml b/docs/api/definitions.yml index a85bff66e303bd73492668d29cf42ee6601b5114..b9e1eeb4236a6195bd1ab1405270097fcc0ccdb0 100644 --- a/docs/api/definitions.yml +++ b/docs/api/definitions.yml @@ -57,7 +57,7 @@ Attachment: example: 2787000 description: "Size of the file, in bytes" mimetype: - $ref: "./properties.yml#image_mimetype" + $ref: "./properties.yml#/image_mimetype" creation_date: type: "string" format: "date-time" @@ -121,7 +121,7 @@ BaseArtist: properties: mbid: required: false - $ref: "./properties.yml#mbid" + $ref: "./properties.yml#/mbid" id: type: "integer" format: "int64" @@ -160,7 +160,7 @@ BaseAlbum: properties: mbid: required: false - $ref: "./properties.yml#mbid" + $ref: "./properties.yml#/mbid" id: type: "integer" format: "int64" @@ -249,11 +249,11 @@ ChannelCreate: example: "aliceandbob" description: "The username to associate with the channel, for use over federation. This cannot be changed afterwards." description: - $ref: "./properties.yml#description" + $ref: "./properties.yml#/description" tags: - $ref: "./properties.yml#tags" + $ref: "./properties.yml#/tags" content_category: - $ref: "./properties.yml#content_category" + $ref: "./properties.yml#/content_category" cover: type: string format: uuid @@ -267,9 +267,9 @@ ChannelUpdate: example: "A short, public name for the channel" maxLength: 255 description: - $ref: "./properties.yml#description" + $ref: "./properties.yml#/description" tags: - $ref: "./properties.yml#tags" + $ref: "./properties.yml#/tags" cover: type: string format: uuid @@ -283,7 +283,7 @@ Channel: type: "string" format: "uuid" creation_date: - $ref: "./properties.yml#creation_date" + $ref: "./properties.yml#/creation_date" artist: $ref: "#/BaseArtist" attributed_to: @@ -299,12 +299,12 @@ Subscription: approved: type: "string" fid: - $ref: "./properties.yml#fid" + $ref: "./properties.yml#/fid" uuid: type: "string" format: "uuid" creation_date: - $ref: "./properties.yml#creation_date" + $ref: "./properties.yml#/creation_date" channel: $ref: "#/Channel" @@ -402,7 +402,7 @@ BaseTrack: properties: mbid: required: false - $ref: "./properties.yml#mbid" + $ref: "./properties.yml#/mbid" id: type: "integer" format: "int64" @@ -472,7 +472,7 @@ ListeningCreate: format: "int64" example: 66 creation_date: - $ref: "./properties.yml#creation_date" + $ref: "./properties.yml#/creation_date" track: type: "integer" format: "int64" @@ -486,7 +486,7 @@ Listening: format: "int64" example: 66 creation_date: - $ref: "./properties.yml#creation_date" + $ref: "./properties.yml#/creation_date" track: $ref: "#/Track" actor: @@ -529,7 +529,7 @@ Upload: example: 128000 description: "Bitrate of the file, in bytes/s" mimetype: - $ref: "./properties.yml#audio_mimetype" + $ref: "./properties.yml#/audio_mimetype" extension: type: string example: "ogg" @@ -556,7 +556,7 @@ OwnedLibraryCreate: type: "string" example: "Lots of interesting content" privacy_level: - $ref: "./properties.yml#privacy_level" + $ref: "./properties.yml#/privacy_level" OwnedLibrary: type: "object" @@ -565,7 +565,7 @@ OwnedLibrary: type: string format: uuid fid: - $ref: "./properties.yml#fid" + $ref: "./properties.yml#/fid" name: type: "string" example: "My Creative Commons library" @@ -573,9 +573,9 @@ OwnedLibrary: type: "string" example: "All content is under CC-BY" creation_date: - $ref: "./properties.yml#creation_date" + $ref: "./properties.yml#/creation_date" privacy_level: - $ref: "./properties.yml#privacy_level" + $ref: "./properties.yml#/privacy_level" uploads_count: type: "integer" format: "int64" @@ -593,7 +593,7 @@ OwnedUpload: - type: "object" properties: import_status: - $ref: "./properties.yml#import_status" + $ref: "./properties.yml#/import_status" track: $ref: "#/Track" library: @@ -629,14 +629,14 @@ Playlist: description: Number of tracks in the playlist example: 76 privacy_level: - $ref: "./properties.yml#privacy_level" + $ref: "./properties.yml#/privacy_level" actor: $ref: "#/Actor" description: Actor owning the playlist creation_date: - $ref: "./properties.yml#creation_date" + $ref: "./properties.yml#/creation_date" modification_date: - $ref: "./properties.yml#modification_date" + $ref: "./properties.yml#/modification_date" PlaylistCreate: @@ -647,7 +647,7 @@ PlaylistCreate: description: Name of the playlist example: "Move your body" privacy_level: - $ref: "./properties.yml#privacy_level" + $ref: "./properties.yml#/privacy_level" PlaylistTrack: type: "object" @@ -662,7 +662,7 @@ PlaylistTrack: example: 16 description: Position of the track in the playlist creation_date: - $ref: "./properties.yml#creation_date" + $ref: "./properties.yml#/creation_date" track: $ref: "#/Track" @@ -675,7 +675,7 @@ ImportMetadata: example: "My Track" required: true mbid: - $ref: "./properties.yml#mbid" + $ref: "./properties.yml#/mbid" required: false copyright: type: "string" @@ -688,7 +688,7 @@ ImportMetadata: required: false description: A license code, as returned by /api/v1/licenses tags: - $ref: "./properties.yml#tags" + $ref: "./properties.yml#/tags" required: false position: description: "Position of the track in the album or channel" @@ -708,7 +708,7 @@ TrackFavorite: user: $ref: "#/User" creation_date: - $ref: "./properties.yml#creation_date" + $ref: "./properties.yml#/creation_date" User: type: "object" properties: @@ -750,7 +750,7 @@ Me: type: "string" format: "date-time" privacy_level: - $ref: "./properties.yml#privacy_level" + $ref: "./properties.yml#/privacy_level" description: Default privacy-level associated with the user account quota_status: $ref: "#/QuotaStatus" @@ -771,7 +771,7 @@ Me: The token expires after 3 days by default. - QuotaStatus: +QuotaStatus: type: "object" properties: max: diff --git a/docs/api/parameters.yml b/docs/api/parameters.yml index 088716e2243fbe6c4778c9a32a5f9df847893e1f..e5d385d9be35f296ef8dbdfcfbaed2ccd770a08f 100644 --- a/docs/api/parameters.yml +++ b/docs/api/parameters.yml @@ -1,5 +1,5 @@ ChannelOrdering: - - $ref: "#/parameters/Ordering" + - $ref: "#/Ordering" - default: "-creation_date" schema: required: false @@ -118,6 +118,20 @@ Scope: - "actor:alice@example.com" - "domain:example.com" +ContentType: + name: "content_type" + in: "query" + default: "all" + description: | + Limits the results to those whose artist content type matches the query. + + schema: + required: false + type: "string" + enum: + - "podcast" + - "music" + Search: name: "q" in: "query" diff --git a/docs/swagger.yml b/docs/swagger.yml index 858b0cc83db2f781ae7e79dc759cd49a7a3f46d9..1272b615f16d77aec62f10f028783b0342d72fc7 100644 --- a/docs/swagger.yml +++ b/docs/swagger.yml @@ -506,6 +506,7 @@ paths: - $ref: "./api/parameters.yml#/PageSize" - $ref: "./api/parameters.yml#/Related" - $ref: "./api/parameters.yml#/Scope" + - $ref: "./api/parameters.yml#/ContentType" responses: 200: diff --git a/front/src/components/library/Albums.vue b/front/src/components/library/Albums.vue index 3e622515a0a48818e379c6fa0ff2792616a0f196..97589d80e3e64aa3ac2cb11bdee8d0534568cee1 100644 --- a/front/src/components/library/Albums.vue +++ b/front/src/components/library/Albums.vue @@ -175,6 +175,8 @@ export default { ordering: this.getOrderingAsString(), playable: "true", tag: this.tags, + include_channels: "true", + content_category: "music" } logger.default.debug("Fetching albums") axios.get(