diff --git a/apps/api/lexicons/actor/getActorAlbums.json b/apps/api/lexicons/actor/getActorAlbums.json index d420159a..8952f15c 100644 --- a/apps/api/lexicons/actor/getActorAlbums.json +++ b/apps/api/lexicons/actor/getActorAlbums.json @@ -25,6 +25,16 @@ "type": "integer", "description": "The offset for pagination", "minimum": 0 + }, + "startDate": { + "type": "string", + "description": "The start date to filter albums from (ISO 8601 format)", + "format": "datetime" + }, + "endDate": { + "type": "string", + "description": "The end date to filter albums to (ISO 8601 format)", + "format": "datetime" } } }, diff --git a/apps/api/lexicons/actor/getActorArtists.json b/apps/api/lexicons/actor/getActorArtists.json index 0d06be78..76be61fb 100644 --- a/apps/api/lexicons/actor/getActorArtists.json +++ b/apps/api/lexicons/actor/getActorArtists.json @@ -25,6 +25,16 @@ "type": "integer", "description": "The offset for pagination", "minimum": 0 + }, + "startDate": { + "type": "string", + "description": "The start date to filter albums from (ISO 8601 format)", + "format": "datetime" + }, + "endDate": { + "type": "string", + "description": "The end date to filter albums to (ISO 8601 format)", + "format": "datetime" } } }, diff --git a/apps/api/lexicons/actor/getActorSongs.json b/apps/api/lexicons/actor/getActorSongs.json index 42cbf434..5ecdec7a 100644 --- a/apps/api/lexicons/actor/getActorSongs.json +++ b/apps/api/lexicons/actor/getActorSongs.json @@ -25,6 +25,16 @@ "type": "integer", "description": "The offset for pagination", "minimum": 0 + }, + "startDate": { + "type": "string", + "description": "The start date to filter albums from (ISO 8601 format)", + "format": "datetime" + }, + "endDate": { + "type": "string", + "description": "The end date to filter albums to (ISO 8601 format)", + "format": "datetime" } } }, diff --git a/apps/api/pkl/defs/actor/getActorAlbums.pkl b/apps/api/pkl/defs/actor/getActorAlbums.pkl index f88f413e..8a6bfd8a 100644 --- a/apps/api/pkl/defs/actor/getActorAlbums.pkl +++ b/apps/api/pkl/defs/actor/getActorAlbums.pkl @@ -1,4 +1,4 @@ -amends "../../schema/lexicon.pkl" +amends "../../schema/lexicon.pkl" lexicon = 1 id = "app.rocksky.actor.getActorAlbums" @@ -13,7 +13,7 @@ defs = new Mapping { description = "The DID or handle of the actor" format = "at-identifier" } - ["limit"] = new IntegerType { + ["limit"] = new IntegerType { type = "integer" description = "The maximum number of albums to return" minimum = 1 @@ -23,6 +23,14 @@ defs = new Mapping { description = "The offset for pagination" minimum = 0 } + ["startDate"] = new StringType { + description = "The start date to filter albums from (ISO 8601 format)" + format = "datetime" + } + ["endDate"] = new StringType { + description = "The end date to filter albums to (ISO 8601 format)" + format = "datetime" + } } } output { @@ -40,4 +48,4 @@ defs = new Mapping { } } } -} \ No newline at end of file +} diff --git a/apps/api/pkl/defs/actor/getActorArtists.pkl b/apps/api/pkl/defs/actor/getActorArtists.pkl index a27669c9..4dc91993 100644 --- a/apps/api/pkl/defs/actor/getActorArtists.pkl +++ b/apps/api/pkl/defs/actor/getActorArtists.pkl @@ -1,4 +1,4 @@ -amends "../../schema/lexicon.pkl" +amends "../../schema/lexicon.pkl" lexicon = 1 id = "app.rocksky.actor.getActorArtists" @@ -13,7 +13,7 @@ defs = new Mapping { description = "The DID or handle of the actor" format = "at-identifier" } - ["limit"] = new IntegerType { + ["limit"] = new IntegerType { type = "integer" description = "The maximum number of albums to return" minimum = 1 @@ -23,6 +23,14 @@ defs = new Mapping { description = "The offset for pagination" minimum = 0 } + ["startDate"] = new StringType { + description = "The start date to filter albums from (ISO 8601 format)" + format = "datetime" + } + ["endDate"] = new StringType { + description = "The end date to filter albums to (ISO 8601 format)" + format = "datetime" + } } } output { @@ -40,4 +48,4 @@ defs = new Mapping { } } } -} \ No newline at end of file +} diff --git a/apps/api/pkl/defs/actor/getActorSongs.pkl b/apps/api/pkl/defs/actor/getActorSongs.pkl index 02d5b116..3389b245 100644 --- a/apps/api/pkl/defs/actor/getActorSongs.pkl +++ b/apps/api/pkl/defs/actor/getActorSongs.pkl @@ -1,4 +1,4 @@ -amends "../../schema/lexicon.pkl" +amends "../../schema/lexicon.pkl" lexicon = 1 id = "app.rocksky.actor.getActorSongs" @@ -23,9 +23,17 @@ defs = new Mapping { description = "The offset for pagination" minimum = 0 } + ["startDate"] = new StringType { + description = "The start date to filter albums from (ISO 8601 format)" + format = "datetime" + } + ["endDate"] = new StringType { + description = "The end date to filter albums to (ISO 8601 format)" + format = "datetime" + } } } - output { + output { encoding = "application/json" schema = new ObjectType { type = "object" @@ -40,4 +48,4 @@ defs = new Mapping { } } } -} \ No newline at end of file +} diff --git a/apps/api/src/lexicon/index.ts b/apps/api/src/lexicon/index.ts index c8ac0882..564c946f 100644 --- a/apps/api/src/lexicon/index.ts +++ b/apps/api/src/lexicon/index.ts @@ -30,8 +30,8 @@ import type * as AppRockskyApikeyCreateApikey from "./types/app/rocksky/apikey/c import type * as AppRockskyApikeyGetApikeys from "./types/app/rocksky/apikey/getApikeys"; import type * as AppRockskyApikeyRemoveApikey from "./types/app/rocksky/apikey/removeApikey"; import type * as AppRockskyApikeyUpdateApikey from "./types/app/rocksky/apikey/updateApikey"; -import type * as AppRockskyArtistGetArtistAlbums from "./types/app/rocksky/artist/getArtistAlbums"; import type * as AppRockskyArtistGetArtist from "./types/app/rocksky/artist/getArtist"; +import type * as AppRockskyArtistGetArtistAlbums from "./types/app/rocksky/artist/getArtistAlbums"; import type * as AppRockskyArtistGetArtistListeners from "./types/app/rocksky/artist/getArtistListeners"; import type * as AppRockskyArtistGetArtists from "./types/app/rocksky/artist/getArtists"; import type * as AppRockskyArtistGetArtistTracks from "./types/app/rocksky/artist/getArtistTracks"; @@ -41,9 +41,9 @@ import type * as AppRockskyDropboxGetFiles from "./types/app/rocksky/dropbox/get import type * as AppRockskyDropboxGetMetadata from "./types/app/rocksky/dropbox/getMetadata"; import type * as AppRockskyDropboxGetTemporaryLink from "./types/app/rocksky/dropbox/getTemporaryLink"; import type * as AppRockskyFeedDescribeFeedGenerator from "./types/app/rocksky/feed/describeFeedGenerator"; +import type * as AppRockskyFeedGetFeed from "./types/app/rocksky/feed/getFeed"; import type * as AppRockskyFeedGetFeedGenerator from "./types/app/rocksky/feed/getFeedGenerator"; import type * as AppRockskyFeedGetFeedGenerators from "./types/app/rocksky/feed/getFeedGenerators"; -import type * as AppRockskyFeedGetFeed from "./types/app/rocksky/feed/getFeed"; import type * as AppRockskyFeedGetFeedSkeleton from "./types/app/rocksky/feed/getFeedSkeleton"; import type * as AppRockskyFeedGetNowPlayings from "./types/app/rocksky/feed/getNowPlayings"; import type * as AppRockskyFeedSearch from "./types/app/rocksky/feed/search"; @@ -65,9 +65,9 @@ import type * as AppRockskyPlayerGetCurrentlyPlaying from "./types/app/rocksky/p import type * as AppRockskyPlayerGetPlaybackQueue from "./types/app/rocksky/player/getPlaybackQueue"; import type * as AppRockskyPlayerNext from "./types/app/rocksky/player/next"; import type * as AppRockskyPlayerPause from "./types/app/rocksky/player/pause"; +import type * as AppRockskyPlayerPlay from "./types/app/rocksky/player/play"; import type * as AppRockskyPlayerPlayDirectory from "./types/app/rocksky/player/playDirectory"; import type * as AppRockskyPlayerPlayFile from "./types/app/rocksky/player/playFile"; -import type * as AppRockskyPlayerPlay from "./types/app/rocksky/player/play"; import type * as AppRockskyPlayerPrevious from "./types/app/rocksky/player/previous"; import type * as AppRockskyPlayerSeek from "./types/app/rocksky/player/seek"; import type * as AppRockskyPlaylistCreatePlaylist from "./types/app/rocksky/playlist/createPlaylist"; @@ -483,25 +483,25 @@ export class AppRockskyArtistNS { this._server = server; } - getArtistAlbums( + getArtist( cfg: ConfigOf< AV, - AppRockskyArtistGetArtistAlbums.Handler>, - AppRockskyArtistGetArtistAlbums.HandlerReqCtx> + AppRockskyArtistGetArtist.Handler>, + AppRockskyArtistGetArtist.HandlerReqCtx> >, ) { - const nsid = "app.rocksky.artist.getArtistAlbums"; // @ts-ignore + const nsid = "app.rocksky.artist.getArtist"; // @ts-ignore return this._server.xrpc.method(nsid, cfg); } - getArtist( + getArtistAlbums( cfg: ConfigOf< AV, - AppRockskyArtistGetArtist.Handler>, - AppRockskyArtistGetArtist.HandlerReqCtx> + AppRockskyArtistGetArtistAlbums.Handler>, + AppRockskyArtistGetArtistAlbums.HandlerReqCtx> >, ) { - const nsid = "app.rocksky.artist.getArtist"; // @ts-ignore + const nsid = "app.rocksky.artist.getArtistAlbums"; // @ts-ignore return this._server.xrpc.method(nsid, cfg); } @@ -628,6 +628,17 @@ export class AppRockskyFeedNS { return this._server.xrpc.method(nsid, cfg); } + getFeed( + cfg: ConfigOf< + AV, + AppRockskyFeedGetFeed.Handler>, + AppRockskyFeedGetFeed.HandlerReqCtx> + >, + ) { + const nsid = "app.rocksky.feed.getFeed"; // @ts-ignore + return this._server.xrpc.method(nsid, cfg); + } + getFeedGenerator( cfg: ConfigOf< AV, @@ -650,17 +661,6 @@ export class AppRockskyFeedNS { return this._server.xrpc.method(nsid, cfg); } - getFeed( - cfg: ConfigOf< - AV, - AppRockskyFeedGetFeed.Handler>, - AppRockskyFeedGetFeed.HandlerReqCtx> - >, - ) { - const nsid = "app.rocksky.feed.getFeed"; // @ts-ignore - return this._server.xrpc.method(nsid, cfg); - } - getFeedSkeleton( cfg: ConfigOf< AV, @@ -924,6 +924,17 @@ export class AppRockskyPlayerNS { return this._server.xrpc.method(nsid, cfg); } + play( + cfg: ConfigOf< + AV, + AppRockskyPlayerPlay.Handler>, + AppRockskyPlayerPlay.HandlerReqCtx> + >, + ) { + const nsid = "app.rocksky.player.play"; // @ts-ignore + return this._server.xrpc.method(nsid, cfg); + } + playDirectory( cfg: ConfigOf< AV, @@ -946,17 +957,6 @@ export class AppRockskyPlayerNS { return this._server.xrpc.method(nsid, cfg); } - play( - cfg: ConfigOf< - AV, - AppRockskyPlayerPlay.Handler>, - AppRockskyPlayerPlay.HandlerReqCtx> - >, - ) { - const nsid = "app.rocksky.player.play"; // @ts-ignore - return this._server.xrpc.method(nsid, cfg); - } - previous( cfg: ConfigOf< AV, diff --git a/apps/api/src/lexicon/lexicons.ts b/apps/api/src/lexicon/lexicons.ts index 5b844ba2..9018d3da 100644 --- a/apps/api/src/lexicon/lexicons.ts +++ b/apps/api/src/lexicon/lexicons.ts @@ -798,6 +798,17 @@ export const schemaDict = { description: "The offset for pagination", minimum: 0, }, + startDate: { + type: "string", + description: + "The start date to filter albums from (ISO 8601 format)", + format: "datetime", + }, + endDate: { + type: "string", + description: "The end date to filter albums to (ISO 8601 format)", + format: "datetime", + }, }, }, output: { @@ -844,6 +855,17 @@ export const schemaDict = { description: "The offset for pagination", minimum: 0, }, + startDate: { + type: "string", + description: + "The start date to filter albums from (ISO 8601 format)", + format: "datetime", + }, + endDate: { + type: "string", + description: "The end date to filter albums to (ISO 8601 format)", + format: "datetime", + }, }, }, output: { @@ -1097,6 +1119,17 @@ export const schemaDict = { description: "The offset for pagination", minimum: 0, }, + startDate: { + type: "string", + description: + "The start date to filter albums from (ISO 8601 format)", + format: "datetime", + }, + endDate: { + type: "string", + description: "The end date to filter albums to (ISO 8601 format)", + format: "datetime", + }, }, }, output: { @@ -1912,20 +1945,20 @@ export const schemaDict = { }, }, }, - AppRockskyArtistGetArtistAlbums: { + AppRockskyArtistGetArtist: { lexicon: 1, - id: "app.rocksky.artist.getArtistAlbums", + id: "app.rocksky.artist.getArtist", defs: { main: { type: "query", - description: "Get artist's albums", + description: "Get artist details", parameters: { type: "params", required: ["uri"], properties: { uri: { type: "string", - description: "The URI of the artist to retrieve albums from", + description: "The URI of the artist to retrieve details from", format: "at-uri", }, }, @@ -1933,35 +1966,27 @@ export const schemaDict = { output: { encoding: "application/json", schema: { - type: "object", - properties: { - albums: { - type: "array", - items: { - type: "ref", - ref: "lex:app.rocksky.album.defs#albumViewBasic", - }, - }, - }, + type: "ref", + ref: "lex:app.rocksky.artist.defs#artistViewDetailed", }, }, }, }, }, - AppRockskyArtistGetArtist: { + AppRockskyArtistGetArtistAlbums: { lexicon: 1, - id: "app.rocksky.artist.getArtist", + id: "app.rocksky.artist.getArtistAlbums", defs: { main: { type: "query", - description: "Get artist details", + description: "Get artist's albums", parameters: { type: "params", required: ["uri"], properties: { uri: { type: "string", - description: "The URI of the artist to retrieve details from", + description: "The URI of the artist to retrieve albums from", format: "at-uri", }, }, @@ -1969,8 +1994,16 @@ export const schemaDict = { output: { encoding: "application/json", schema: { - type: "ref", - ref: "lex:app.rocksky.artist.defs#artistViewDetailed", + type: "object", + properties: { + albums: { + type: "array", + items: { + type: "ref", + ref: "lex:app.rocksky.album.defs#albumViewBasic", + }, + }, + }, }, }, }, @@ -2603,98 +2636,98 @@ export const schemaDict = { }, }, }, - AppRockskyFeedGetFeedGenerator: { + AppRockskyFeedGetFeed: { lexicon: 1, - id: "app.rocksky.feed.getFeedGenerator", + id: "app.rocksky.feed.getFeed", defs: { main: { type: "query", - description: "Get information about a feed generator", + description: "Get the feed by uri", parameters: { type: "params", required: ["feed"], properties: { feed: { type: "string", - description: "AT-URI of the feed generator record.", + description: "The feed URI.", format: "at-uri", }, + limit: { + type: "integer", + description: "The maximum number of scrobbles to return", + minimum: 1, + }, + cursor: { + type: "string", + description: "The cursor for pagination", + }, }, }, output: { encoding: "application/json", schema: { - type: "object", - properties: { - view: { - type: "ref", - ref: "lex:app.rocksky.feed.defs#feedGeneratorView", - }, - }, + type: "ref", + ref: "lex:app.rocksky.feed.defs#feedView", }, }, }, }, }, - AppRockskyFeedGetFeedGenerators: { + AppRockskyFeedGetFeedGenerator: { lexicon: 1, - id: "app.rocksky.feed.getFeedGenerators", + id: "app.rocksky.feed.getFeedGenerator", defs: { main: { type: "query", - description: "Get all feed generators", + description: "Get information about a feed generator", parameters: { type: "params", + required: ["feed"], properties: { - size: { - type: "integer", - description: "The maximum number of feed generators to return.", - minimum: 1, + feed: { + type: "string", + description: "AT-URI of the feed generator record.", + format: "at-uri", }, }, }, output: { encoding: "application/json", schema: { - type: "ref", - ref: "lex:app.rocksky.feed.defs#feedGeneratorsView", + type: "object", + properties: { + view: { + type: "ref", + ref: "lex:app.rocksky.feed.defs#feedGeneratorView", + }, + }, }, }, }, }, }, - AppRockskyFeedGetFeed: { + AppRockskyFeedGetFeedGenerators: { lexicon: 1, - id: "app.rocksky.feed.getFeed", + id: "app.rocksky.feed.getFeedGenerators", defs: { main: { type: "query", - description: "Get the feed by uri", + description: "Get all feed generators", parameters: { type: "params", - required: ["feed"], properties: { - feed: { - type: "string", - description: "The feed URI.", - format: "at-uri", - }, - limit: { + size: { type: "integer", - description: "The maximum number of scrobbles to return", + description: "The maximum number of feed generators to return.", minimum: 1, }, - cursor: { - type: "string", - description: "The cursor for pagination", - }, }, }, output: { encoding: "application/json", schema: { type: "ref", - ref: "lex:app.rocksky.feed.defs#feedView", + ref: "lex:app.rocksky.feed.defs#feedGeneratorsView", }, }, }, @@ -2956,6 +2989,36 @@ export const schemaDict = { }, }, }, + AppRockskyGraphFollow: { + lexicon: 1, + id: "app.rocksky.graph.follow", + defs: { + main: { + type: "record", + description: + "Record declaring a social 'follow' relationship of another account.", + key: "tid", + record: { + type: "object", + required: ["createdAt", "subject"], + properties: { + createdAt: { + type: "string", + format: "datetime", + }, + subject: { + type: "string", + format: "did", + }, + via: { + type: "ref", + ref: "lex:com.atproto.repo.strongRef", + }, + }, + }, + }, + }, + }, AppRockskyGraphFollowAccount: { lexicon: 1, id: "app.rocksky.graph.followAccount", @@ -3002,36 +3065,6 @@ export const schemaDict = { }, }, }, - AppRockskyGraphFollow: { - lexicon: 1, - id: "app.rocksky.graph.follow", - defs: { - main: { - type: "record", - description: - "Record declaring a social 'follow' relationship of another account.", - key: "tid", - record: { - type: "object", - required: ["createdAt", "subject"], - properties: { - createdAt: { - type: "string", - format: "datetime", - }, - subject: { - type: "string", - format: "did", - }, - via: { - type: "ref", - ref: "lex:com.atproto.repo.strongRef", - }, - }, - }, - }, - }, - }, AppRockskyGraphGetFollowers: { lexicon: 1, id: "app.rocksky.graph.getFollowers", @@ -3602,6 +3635,24 @@ export const schemaDict = { }, }, }, + AppRockskyPlayerPlay: { + lexicon: 1, + id: "app.rocksky.player.play", + defs: { + main: { + type: "procedure", + description: "Resume playback of the currently paused track", + parameters: { + type: "params", + properties: { + playerId: { + type: "string", + }, + }, + }, + }, + }, + }, AppRockskyPlayerPlayDirectory: { lexicon: 1, id: "app.rocksky.player.playDirectory", @@ -3655,24 +3706,6 @@ export const schemaDict = { }, }, }, - AppRockskyPlayerPlay: { - lexicon: 1, - id: "app.rocksky.player.play", - defs: { - main: { - type: "procedure", - description: "Resume playback of the currently paused track", - parameters: { - type: "params", - properties: { - playerId: { - type: "string", - }, - }, - }, - }, - }, - }, AppRockskyPlayerPrevious: { lexicon: 1, id: "app.rocksky.player.previous", @@ -5918,8 +5951,8 @@ export const ids = { AppRockskyApikeyUpdateApikey: "app.rocksky.apikey.updateApikey", AppRockskyArtist: "app.rocksky.artist", AppRockskyArtistDefs: "app.rocksky.artist.defs", - AppRockskyArtistGetArtistAlbums: "app.rocksky.artist.getArtistAlbums", AppRockskyArtistGetArtist: "app.rocksky.artist.getArtist", + AppRockskyArtistGetArtistAlbums: "app.rocksky.artist.getArtistAlbums", AppRockskyArtistGetArtistListeners: "app.rocksky.artist.getArtistListeners", AppRockskyArtistGetArtists: "app.rocksky.artist.getArtists", AppRockskyArtistGetArtistTracks: "app.rocksky.artist.getArtistTracks", @@ -5933,9 +5966,9 @@ export const ids = { AppRockskyFeedDefs: "app.rocksky.feed.defs", AppRockskyFeedDescribeFeedGenerator: "app.rocksky.feed.describeFeedGenerator", AppRockskyFeedGenerator: "app.rocksky.feed.generator", + AppRockskyFeedGetFeed: "app.rocksky.feed.getFeed", AppRockskyFeedGetFeedGenerator: "app.rocksky.feed.getFeedGenerator", AppRockskyFeedGetFeedGenerators: "app.rocksky.feed.getFeedGenerators", - AppRockskyFeedGetFeed: "app.rocksky.feed.getFeed", AppRockskyFeedGetFeedSkeleton: "app.rocksky.feed.getFeedSkeleton", AppRockskyFeedGetNowPlayings: "app.rocksky.feed.getNowPlayings", AppRockskyFeedSearch: "app.rocksky.feed.search", @@ -5944,8 +5977,8 @@ export const ids = { AppRockskyGoogledriveGetFile: "app.rocksky.googledrive.getFile", AppRockskyGoogledriveGetFiles: "app.rocksky.googledrive.getFiles", AppRockskyGraphDefs: "app.rocksky.graph.defs", - AppRockskyGraphFollowAccount: "app.rocksky.graph.followAccount", AppRockskyGraphFollow: "app.rocksky.graph.follow", + AppRockskyGraphFollowAccount: "app.rocksky.graph.followAccount", AppRockskyGraphGetFollowers: "app.rocksky.graph.getFollowers", AppRockskyGraphGetFollows: "app.rocksky.graph.getFollows", AppRockskyGraphGetKnownFollowers: "app.rocksky.graph.getKnownFollowers", @@ -5962,9 +5995,9 @@ export const ids = { AppRockskyPlayerGetPlaybackQueue: "app.rocksky.player.getPlaybackQueue", AppRockskyPlayerNext: "app.rocksky.player.next", AppRockskyPlayerPause: "app.rocksky.player.pause", + AppRockskyPlayerPlay: "app.rocksky.player.play", AppRockskyPlayerPlayDirectory: "app.rocksky.player.playDirectory", AppRockskyPlayerPlayFile: "app.rocksky.player.playFile", - AppRockskyPlayerPlay: "app.rocksky.player.play", AppRockskyPlayerPrevious: "app.rocksky.player.previous", AppRockskyPlayerSeek: "app.rocksky.player.seek", AppRockskyPlaylistCreatePlaylist: "app.rocksky.playlist.createPlaylist", diff --git a/apps/api/src/lexicon/types/app/rocksky/actor/getActorAlbums.ts b/apps/api/src/lexicon/types/app/rocksky/actor/getActorAlbums.ts index 91b9d83e..a137d493 100644 --- a/apps/api/src/lexicon/types/app/rocksky/actor/getActorAlbums.ts +++ b/apps/api/src/lexicon/types/app/rocksky/actor/getActorAlbums.ts @@ -16,6 +16,10 @@ export interface QueryParams { limit?: number; /** The offset for pagination */ offset?: number; + /** The start date to filter albums from (ISO 8601 format) */ + startDate?: string; + /** The end date to filter albums to (ISO 8601 format) */ + endDate?: string; } export type InputSchema = undefined; diff --git a/apps/api/src/lexicon/types/app/rocksky/actor/getActorArtists.ts b/apps/api/src/lexicon/types/app/rocksky/actor/getActorArtists.ts index ec112805..97c79d90 100644 --- a/apps/api/src/lexicon/types/app/rocksky/actor/getActorArtists.ts +++ b/apps/api/src/lexicon/types/app/rocksky/actor/getActorArtists.ts @@ -16,6 +16,10 @@ export interface QueryParams { limit?: number; /** The offset for pagination */ offset?: number; + /** The start date to filter albums from (ISO 8601 format) */ + startDate?: string; + /** The end date to filter albums to (ISO 8601 format) */ + endDate?: string; } export type InputSchema = undefined; diff --git a/apps/api/src/lexicon/types/app/rocksky/actor/getActorSongs.ts b/apps/api/src/lexicon/types/app/rocksky/actor/getActorSongs.ts index cc79c110..c74d2026 100644 --- a/apps/api/src/lexicon/types/app/rocksky/actor/getActorSongs.ts +++ b/apps/api/src/lexicon/types/app/rocksky/actor/getActorSongs.ts @@ -16,6 +16,10 @@ export interface QueryParams { limit?: number; /** The offset for pagination */ offset?: number; + /** The start date to filter albums from (ISO 8601 format) */ + startDate?: string; + /** The end date to filter albums to (ISO 8601 format) */ + endDate?: string; } export type InputSchema = undefined; diff --git a/apps/api/src/xrpc/app/rocksky/actor/getActorAlbums.ts b/apps/api/src/xrpc/app/rocksky/actor/getActorAlbums.ts index 2ca96dca..7ec662bc 100644 --- a/apps/api/src/xrpc/app/rocksky/actor/getActorAlbums.ts +++ b/apps/api/src/xrpc/app/rocksky/actor/getActorAlbums.ts @@ -45,6 +45,8 @@ const retrieve = ({ skip: params.offset || 0, take: params.limit || 10, }, + start_date: params.startDate, + end_date: params.endDate, }), catch: (error) => new Error(`Failed to retrieve albums: ${error}`), }); diff --git a/apps/api/src/xrpc/app/rocksky/actor/getActorArtists.ts b/apps/api/src/xrpc/app/rocksky/actor/getActorArtists.ts index 26883f31..babd1cb8 100644 --- a/apps/api/src/xrpc/app/rocksky/actor/getActorArtists.ts +++ b/apps/api/src/xrpc/app/rocksky/actor/getActorArtists.ts @@ -44,6 +44,8 @@ const retrieve = ({ skip: params.offset || 0, take: params.limit || 10, }, + start_date: params.startDate, + end_date: params.endDate, }), catch: (error) => new Error(`Failed to retrieve artists: ${error}`), }); diff --git a/apps/api/src/xrpc/app/rocksky/actor/getActorSongs.ts b/apps/api/src/xrpc/app/rocksky/actor/getActorSongs.ts index 0a184bfa..df7ebf97 100644 --- a/apps/api/src/xrpc/app/rocksky/actor/getActorSongs.ts +++ b/apps/api/src/xrpc/app/rocksky/actor/getActorSongs.ts @@ -44,6 +44,8 @@ const retrieve = ({ skip: params.offset || 0, take: params.limit || 10, }, + start_date: params.startDate, + end_date: params.endDate, }), catch: (error) => new Error(`Failed to retrieve tracks: ${error}`), }); diff --git a/apps/api/src/xrpc/app/rocksky/scrobble/getScrobbles.ts b/apps/api/src/xrpc/app/rocksky/scrobble/getScrobbles.ts index 9749b485..8baabc02 100644 --- a/apps/api/src/xrpc/app/rocksky/scrobble/getScrobbles.ts +++ b/apps/api/src/xrpc/app/rocksky/scrobble/getScrobbles.ts @@ -118,9 +118,7 @@ const enrichWithLikes = async ( const likesMap = new Map(); for (const trackId of trackIds) { - const trackLikes = likes.filter( - (l) => l.loved_tracks.trackId === trackId, - ); + const trackLikes = likes.filter((l) => l.loved_tracks.trackId === trackId); likesMap.set(trackId, { count: trackLikes.length, liked: trackLikes.some((l) => l.users?.did === currentUserDid),