Support analyze .strm files
Add support for analyzing .strm files and include an option to disable this feature. Since analyzing .strm files may trigger rate limits, it is turned off by default.
#594
Summary by Sourcery
Enable support for analyzing .strm shortcut videos by tracking and routing analysis to their real paths, probing durations with ffprobe to adjust fingerprinting, and controlling the feature via a new ProcessShortcutVideos configuration option.
New Features:
- Add ProcessShortcutVideos option to enable or disable analyzing .strm shortcut files
Enhancements:
- Introduce IsShortcut and ShortcutPath on queued media and route FFmpeg analysis to shortcut paths where applicable
- Integrate ffprobe-based duration probing to determine real runtime for shortcut files and adjust fingerprint analysis ranges
- Update QueueManager to skip or process shortcut videos based on the new setting and recalculate intro/credits segments after probing duration
Documentation:
- Add ProcessShortcutVideos checkbox to the plugin configuration UI
Reviewer's Guide
Implements optional support for analyzing .strm shortcut files by extending the data model with shortcut metadata and a new configuration flag, updating the queue logic to initialize, skip or probe shortcut items based on that setting, adapting FFmpegWrapper to use shortcut paths and adding ffprobe-based duration probing methods, and exposing a ProcessShortcutVideos option in the UI.
Entity relationship diagram for shortcut video support in QueuedEpisode
erDiagram
QUEUEDEPISODE {
string Path
string ShortcutPath
bool IsShortcut
}
PLUGINCONFIGURATION {
bool ProcessShortcutVideos
}
QUEUEDEPISODE ||--|| PLUGINCONFIGURATION : "uses config for shortcut processing"
Class diagram for updated QueuedEpisode and PluginConfiguration
classDiagram
class QueuedEpisode {
string Path
string ShortcutPath
bool IsExcluded
bool IsShortcut
...
}
class PluginConfiguration {
bool AnalyzeSeasonZero
bool ProcessShortcutVideos
...
}
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Introduce shortcut metadata and configuration flag for processing .strm files |
|
IntroSkipper/Data/QueuedEpisode.csIntroSkipper/Configuration/PluginConfiguration.cs |
| Expose ProcessShortcutVideos setting in the configuration UI |
|
IntroSkipper/Configuration/configPage.html |
| Adapt FFmpegWrapper to handle shortcut paths and add ffprobe duration probing |
|
IntroSkipper/FFmpegWrapper.cs |
| Update queue management to initialize, skip, and probe shortcut media |
|
IntroSkipper/Manager/QueueManager.cs |
Possibly linked issues
- #594: The PR adds support for analyzing .strm files by using ffprobe to determine media duration and provides a toggle for this feature.
Tips and commands
Interacting with Sourcery
- Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
- Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with
@sourcery-ai issueto create an issue from it. - Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. You can also comment@sourcery-ai titleon the pull request to (re-)generate the title at any time. - Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment@sourcery-ai summaryon the pull request to (re-)generate the summary at any time. - Generate reviewer's guide: Comment
@sourcery-ai guideon the pull request to (re-)generate the reviewer's guide at any time. - Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore. - Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment@sourcery-ai reviewto trigger a new review!
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
I'm not sure "shortcut" is the best name for it. That's just personal opinion, though. You may also want to consider the suggestion sourcery had about checking ffprobe for a clean exit, since we are talking about videos that don't actually exist on the system.
I'm not sure "shortcut" is the best name for it. That's just personal opinion, though. You may also want to consider the suggestion sourcery had about checking ffprobe for a clean exit, since we are talking about videos that don't actually exist on the system.
The name "shortcut" following Jellyfin's. Do you have any alternative naming suggestions? I have modified it to ensure ffprobe exits cleanly.
I need to point out that analyzing a large number of .strm files with ffmpeg does easily trigger rate limits. My current implementation is indeed not very good and tends to trigger restrictions, making it generally difficult to complete the analysis. It may be better to use another task to analyze in batches slowly.
Something as simple as "isShortcutVideo" would avoid any references being mistaken as a different type of shortcut down the line.
What copilot is complaining about with the exit codes can be silenced with something like
ffprobe.WaitForExit(timeout);
if (ffprobe.HasExited)
{
if (ffprobe.ExitCode != 0)
{
Logger?.LogWarning("ffprobe exited with code {ExitCode} for arguments: {Arguments}", ffprobe.ExitCode, ffprobe.StartInfo.Arguments);
}
} else {
// Handle timeout: kill process and log error
try
{
ffprobe.Kill();
}
catch (InvalidOperationException)
{
// ignore if already exited
}
catch (Exception ex)
{
Logger?.LogWarning("Unexpected exception when killing ffprobe: {Message}", ex.Message);
}
}
And thanks for the submission. This is something that has been requested before.
I don't think we will add this feature. From my point of view, it would just cause a lot of support work on our side. It makes sense that Jellyfin doesn't store the duration, given that the content of the file can change at any time.
Okay, Jellyfin will store the duration after the media has been played,possibly due to the request rate limit.