Skip to content

Commit 44f2a29

Browse files
committed
feat(lzendpoint): Add MS specific timestamp SOC to payload
#360
1 parent e061540 commit 44f2a29

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/backend/common/vendor/ListenbrainzApiClient.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { stringSameness } from '@foxxmd/string-sameness';
22
import dayjs from "dayjs";
33
import request, { Request, Response } from 'superagent';
4-
import { BrainzMeta, PlayObject, URLData } from "../../../core/Atomic.js";
4+
import { BrainzMeta, PlayObject, SCROBBLE_TS_SOC_START, URLData } from "../../../core/Atomic.js";
55
import { combinePartsToString, slice } from "../../../core/StringUtils.js";
66
import {
77
findDelimiters,
@@ -263,7 +263,8 @@ export class ListenbrainzApiClient extends AbstractApiClient {
263263
release_mbid,
264264
release_group_mbid,
265265
release_artist_name,
266-
release_artist_names = []
266+
release_artist_names = [],
267+
scrobble_ts_soc = SCROBBLE_TS_SOC_START
267268
} = {}
268269
} = {},
269270
} = payload;
@@ -295,6 +296,7 @@ export class ListenbrainzApiClient extends AbstractApiClient {
295296
},
296297
meta: {
297298
nowPlaying,
299+
scrobbleTsSOC: scrobble_ts_soc
298300
}
299301
}
300302
}

src/backend/common/vendor/listenbrainz/interfaces.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* https://musicbrainz.org/doc/MusicBrainz_Database/Schema#Overview
44
*/
55

6+
import { ScrobbleTsSOC } from "../../../../core/Atomic.js";
7+
68
/** A unique product a Recording is issued on.
79
*
810
* This is like an album (release group) but is specific to the type, year, catalog, etc... for this release
@@ -123,6 +125,11 @@ export interface SubmitListenAdditionalTrackInfo extends AdditionalTrackInfo {
123125
spotify_album_artist_ids?: string[];
124126
spotify_artist_ids?: string[];
125127
albumartist?: string;
128+
/** Is the timestamp (listened_at) from when the user started listening or when they stopped listening?
129+
*
130+
* Specific to multi-scrobbler
131+
*/
132+
scrobble_ts_soc?: ScrobbleTsSOC
126133
}
127134
export interface TrackPayload extends MinimumTrack {
128135
additional_info?: SubmitListenAdditionalTrackInfo;

0 commit comments

Comments
 (0)