mirror of
https://github.com/narrrl/proton-stream.git
synced 2026-11-03 16:41:26 +01:00
feat(core,app,cli): pair subtitle files with their video and play them
A crawl now keeps .srt/.ass/.ssa/.vtt files and pairs each with a video by name: the video's name followed by a dot or nothing, the same inside a Subs folder, the Subs/<video>/ layout, and failing those the only video in the folder. The words past the video's name give the language and the picker's title. They go in a new sidecars table (schema v12), rebuilt by every crawl. The desktop opens them while mpv opens the video and adds them with sub-add through the stream registry once the file has loaded. One in the preferred language is turned on when subtitles are on and the file has none of its own playing; the rest wait in the subtitle menu.
This commit is contained in:
1 parent
51454b5a6e
commit
f0fe90f0fe
6 files changed
+564
-6
No files matched your search
@@ -9,7 +9,7 @@ use anyhow::{Context, Result};
|
||||
use clap::{Parser, Subcommand};
|
||||
use proton_sdk::ids::{LinkId, NodeUid, VolumeId};
|
||||
use pstr_core::account::{PlaceKind, SignIn};
|
||||
use pstr_core::catalog::{Catalog, build_rows};
|
||||
use pstr_core::catalog::{Catalog, build_rows, build_sidecars};
|
||||
use pstr_core::config::AppDirs;
|
||||
use pstr_core::shares::AccountFolder;
|
||||
use pstr_core::sync::WatchSync;
|
||||
@@ -425,6 +425,9 @@ async fn run(runtime: std::sync::Arc<tokio::runtime::Runtime>) -> Result<()> {
|
||||
|
||||
catalog
|
||||
.replace_share(&share_id, &rows)
|
||||
.and_then(|()| {
|
||||
catalog.replace_sidecars(&share_id, &build_sidecars(&share_id, &nodes))
|
||||
})
|
||||
.with_context(|| format!("store {share_id}"))?;
|
||||
|
||||
println!(
|
||||
|
||||
Reference in new issue
Block a user