mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-23 00:11:28 -07:00
fix: persist canonical title from youtube metadata
This commit is contained in:
@@ -42,6 +42,8 @@ Recent sessions, streak calendar, watch-time history, and a tracking snapshot wi
|
|||||||
|
|
||||||
Cover-art library with search and sorting, per-series progress, episode drill-down, and direct links into mined cards.
|
Cover-art library with search and sorting, per-series progress, episode drill-down, and direct links into mined cards.
|
||||||
|
|
||||||
|
When YouTube channel metadata is available, the Library tab groups videos by creator/channel and treats each tracked video as an episode-like entry inside that channel section.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
#### Trends
|
#### Trends
|
||||||
|
|||||||
@@ -2369,8 +2369,18 @@ printf '%s\n' '{"id":"abc123","title":"Video Name","webpage_url":"https://www.yo
|
|||||||
uploaderUrl: string;
|
uploaderUrl: string;
|
||||||
description: string;
|
description: string;
|
||||||
} | null;
|
} | null;
|
||||||
|
const videoRow = privateApi.db
|
||||||
|
.prepare(
|
||||||
|
`
|
||||||
|
SELECT canonical_title AS canonicalTitle
|
||||||
|
FROM imm_videos
|
||||||
|
WHERE video_id = 1
|
||||||
|
`,
|
||||||
|
)
|
||||||
|
.get() as { canonicalTitle: string } | null;
|
||||||
|
|
||||||
assert.ok(row);
|
assert.ok(row);
|
||||||
|
assert.ok(videoRow);
|
||||||
assert.equal(row.youtubeVideoId, 'abc123');
|
assert.equal(row.youtubeVideoId, 'abc123');
|
||||||
assert.equal(row.videoUrl, 'https://www.youtube.com/watch?v=abc123');
|
assert.equal(row.videoUrl, 'https://www.youtube.com/watch?v=abc123');
|
||||||
assert.equal(row.videoTitle, 'Video Name');
|
assert.equal(row.videoTitle, 'Video Name');
|
||||||
@@ -2382,6 +2392,7 @@ printf '%s\n' '{"id":"abc123","title":"Video Name","webpage_url":"https://www.yo
|
|||||||
assert.equal(row.uploaderId, '@creator');
|
assert.equal(row.uploaderId, '@creator');
|
||||||
assert.equal(row.uploaderUrl, 'https://www.youtube.com/@creator');
|
assert.equal(row.uploaderUrl, 'https://www.youtube.com/@creator');
|
||||||
assert.equal(row.description, 'Video description');
|
assert.equal(row.description, 'Video description');
|
||||||
|
assert.equal(videoRow.canonicalTitle, 'Video Name');
|
||||||
} finally {
|
} finally {
|
||||||
process.env.PATH = originalPath;
|
process.env.PATH = originalPath;
|
||||||
globalThis.fetch = originalFetch;
|
globalThis.fetch = originalFetch;
|
||||||
|
|||||||
@@ -909,6 +909,9 @@ export class ImmersionTrackerService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
upsertYoutubeVideoMetadata(this.db, videoId, metadata);
|
upsertYoutubeVideoMetadata(this.db, videoId, metadata);
|
||||||
|
if (metadata.videoTitle?.trim()) {
|
||||||
|
updateVideoTitleRecord(this.db, videoId, metadata.videoTitle.trim());
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.debug(
|
this.logger.debug(
|
||||||
'youtube metadata capture skipped for videoId=%d: %s',
|
'youtube metadata capture skipped for videoId=%d: %s',
|
||||||
|
|||||||
Reference in New Issue
Block a user