Select the types of activity you want to include in your feed.
refactor: Remove indexed prop from PlayMeta
* Remove indexed any prop so meta is stricter (better catching bugs) * Implement mergeable generic with meta where we do need extra prop * Fix bad usage of meta now that indexed prop is gone
···33import { plays as drizzlePlays } from '../drizzle/schema/schema.js';
44import clone from 'clone';
55import { eq } from 'drizzle-orm';
66+import { PlayLifecycle, PlayObject } from '../../../../core/Atomic.js';
677889export const up: Migration<MigrateBaseContext>['up'] = async (db: SqliteDatabase, ctx: MigrateBaseContext): Promise<void> => {
···1617 while (more) {
1718 const playRows = await ctx.db.select().from(drizzlePlays).limit(100).offset(offset);
1819 for (const row of playRows) {
2020+ const play = row.play as PlayObject<{lifecycle?: PlayLifecycle}>;
1921 try {
2022 const {
2123 meta: {
···2527 scrobble
2628 } = {}
2729 } = {}
2828- } = row.play;
3030+ } = play;
2931 if (lifecycle === undefined) {
3032 // already migrated or unneeded
3133 processed++;
···3739 if (scrobble !== undefined) {
3840 row.play.scrobble = clone(scrobble);
3941 }
4242+ // @ts-expect-error
4043 delete row.play.meta.lifecycle;
4144 await ctx.db.update(drizzlePlays).set({ play: row.play }).where(eq(drizzlePlays.id, row.id));
4245 updated++;
+2-4
src/backend/common/vendor/LastfmApiClient.ts
···311311 playDate,
312312 },
313313 meta: {
314314- mbid,
315314 nowPlaying,
316315 }
317316 } = formatted;
···319318 // if the track is "now playing" it doesn't get a timestamp so we can't determine when it started playing
320319 // and don't want to accidentally count the same track at different timestamps by artificially assigning it 'now' as a timestamp
321320 // so we'll just ignore it in the context of recent tracks since really we only want "tracks that have already finished being played" anyway
322322- this.logger.trace({ track, mbid }, `Ignoring 'now playing' track returned from ${this.upstreamName} client`);
321321+ this.logger.trace({ track }, `Ignoring 'now playing' track returned from ${this.upstreamName} client`);
323322 return acc;
324323 } else if (playDate === undefined) {
325324 if(nowPlaying === true) {
326325 formatted.data.playDate = dayjs();
327326 } else {
328328- this.logger.warn({ track, mbid }, `${this.upstreamName} recently scrobbled track did not contain a timestamp, omitting from time frame check`);
327327+ this.logger.warn({ track }, `${this.upstreamName} recently scrobbled track did not contain a timestamp, omitting from time frame check`);
329328 return acc;
330329 }
331330 }
···706705 },
707706 meta: {
708707 nowPlaying: nowplaying === 'true',
709709- mbid,
710708 source,
711709 url: {
712710 web: url,