feat(server): add program_extra table and scanner hooks (Phase 0) - #1897
feat(server): add program_extra table and scanner hooks (Phase 0)#1897coreyjv wants to merge 2 commits into
Conversation
chrisbenincasa
left a comment
There was a problem hiding this comment.
Wondering if you've thought at all about how we'll represent these in the search index?
| .returning({ uuid: ProgramExtra.uuid }) | ||
| .all(); | ||
|
|
||
| for (let i = 0; i < batch.length; i++) { |
There was a problem hiding this comment.
I think this could be slightly cleaner, avoid the issue with array index access nullish stuff, and avoid object spreads with something like:
zip(upserted, batch).forEach(([{uuid: persistedUuid}, extra]) => {
for (const art of extra.artwork) {
art.programExtraId = persistedUuid;
allArtwork.push(art);
}
})This assumes that the length of upserted and batch are strictly the same, which I think we can assume.
There was a problem hiding this comment.
This didn't actually resolve the undefined issues so I put in isNonEmptyString for now.
There was a problem hiding this comment.
Ah hm, I didn't think that drizzle would return that as optional on the query (I figured the nullish was just coming from the chaining on the array)
83cef4e to
3ba65c3
Compare
I have not to be perfectly honest. |
|
re: search index - like other things I'm guessing these will be nested objects on the |
Introduce the vendor-agnostic foundation for persisting program extras from remote media sources. - Add `program_extra` table with dual nullable parent FKs covering all four content levels (movie, episode, show, season) - Add `ProgramExtraMinter` injectable class for minting extra + artwork DAOs from `MediaSourceExtra` input - Add `ProgramExtraRepository` and `upsertProgramExtras()` on `IProgramDB` / `ProgramDB` - Add `MediaSourceExtra` type to `Media.ts` using `RemoteSourceType` - Add no-op `scanExtrasForMovie()` hook to `MediaSourceMovieLibraryScanner`, called for both unchanged and newly-upserted movies - Add no-op `scanExtrasForShow/Season/Episode()` hooks to `MediaSourceTvShowLibraryScanner` with equivalent call-site coverage � Conflicts: � server/src/services/scanner/MediaSourceMovieLibraryScanner.ts � server/src/services/scanner/MediaSourceTvShowLibraryScanner.ts
6dc3c3d to
ab37497
Compare
|
I believe I've addressed all the comments I can. I'm not certain if that melisearch limitation is a blocker and if you want me to make specific changes related to it. Let me know if you want me to flip this PR to ready for review. Thanks! |
ab37497 to
6638a4f
Compare
|
Yup, let's un-draft it! |
Introduce the vendor-agnostic foundation for persisting program extras from remote media sources.
program_extratable with dual nullable parent FKs covering all four content levels (movie, episode, show, season)ProgramExtraMinterinjectable class for minting extra + artwork DAOs fromMediaSourceExtrainputProgramExtraRepositoryandupsertProgramExtras()onIProgramDB/ProgramDBMediaSourceExtratype toMedia.tsusingRemoteSourceTypescanExtrasForMovie()hook toMediaSourceMovieLibraryScanner, called for both unchanged and newly-upserted moviesscanExtrasForShow/Season/Episode()hooks toMediaSourceTvShowLibraryScannerwith equivalent call-site coverage