Chapter extraction during library sync (ffprobe) #5
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#2
What to build
During library sync, extract chapter markers from media files using ffprobe and store them on the MediaItem. The Chapter value object and the
chaptersfield on MediaItem already exist (added during the restructure). The migration for thechapterscolumn onlibrary_itemsalso exists.Implement the ffprobe invocation: run
ffprobe -v quiet -print_format json -show_chapters <source_uri>, parse the JSON output intoVec<Chapter>. Only probe items wherecontent_typeis Movie orduration_secs > 2700(45 minutes) — don't waste time on short episodes.The chapter extraction should happen in the library sync adapter. When a provider syncs items into the library, after fetching metadata, probe for chapters if the source URI is a local file path or a network URL that ffprobe can read. Store the extracted chapters as a JSON array in the
chapterscolumn.Acceptance criteria
Vec<Chapter>(title, start_secs, end_secs)Blocked by
None — can start immediately