aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
authorTim Eisele <Shadowghost@users.noreply.github.com>2024-09-07 19:23:48 +0200
committerGitHub <noreply@github.com>2024-09-07 11:23:48 -0600
commitc56dbc1c4410e1b0ec31ca901809b6f627bbb6ed (patch)
tree56df7024be555125eae955da94dd5dda248b8f59 /MediaBrowser.Controller
parent675a8a9ec91da47e37ace6161ba5a5a0e20a7839 (diff)
Enhance Trickplay (#11883)
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs7
-rw-r--r--MediaBrowser.Controller/Trickplay/ITrickplayManager.cs34
2 files changed, 38 insertions, 3 deletions
diff --git a/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs b/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs
index 9e91a8bcd..0bab2a6b9 100644
--- a/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs
+++ b/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs
@@ -29,6 +29,7 @@ namespace MediaBrowser.Controller.Providers
IsAutomated = copy.IsAutomated;
ImageRefreshMode = copy.ImageRefreshMode;
ReplaceAllImages = copy.ReplaceAllImages;
+ RegenerateTrickplay = copy.RegenerateTrickplay;
ReplaceImages = copy.ReplaceImages;
SearchResult = copy.SearchResult;
RemoveOldMetadata = copy.RemoveOldMetadata;
@@ -47,6 +48,12 @@ namespace MediaBrowser.Controller.Providers
/// </summary>
public bool ReplaceAllMetadata { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether all existing trickplay images should be overwritten
+ /// when paired with MetadataRefreshMode=FullRefresh.
+ /// </summary>
+ public bool RegenerateTrickplay { get; set; }
+
public MetadataRefreshMode MetadataRefreshMode { get; set; }
public RemoteSearchResult SearchResult { get; set; }
diff --git a/MediaBrowser.Controller/Trickplay/ITrickplayManager.cs b/MediaBrowser.Controller/Trickplay/ITrickplayManager.cs
index 0c41f3023..bda794aa6 100644
--- a/MediaBrowser.Controller/Trickplay/ITrickplayManager.cs
+++ b/MediaBrowser.Controller/Trickplay/ITrickplayManager.cs
@@ -18,9 +18,10 @@ public interface ITrickplayManager
/// </summary>
/// <param name="video">The video.</param>
/// <param name="replace">Whether or not existing data should be replaced.</param>
+ /// <param name="libraryOptions">The library options.</param>
/// <param name="cancellationToken">CancellationToken to use for operation.</param>
/// <returns>Task.</returns>
- Task RefreshTrickplayDataAsync(Video video, bool replace, CancellationToken cancellationToken);
+ Task RefreshTrickplayDataAsync(Video video, bool replace, LibraryOptions? libraryOptions, CancellationToken cancellationToken);
/// <summary>
/// Creates trickplay tiles out of individual thumbnails.
@@ -33,7 +34,7 @@ public interface ITrickplayManager
/// <remarks>
/// The output directory will be DELETED and replaced if it already exists.
/// </remarks>
- TrickplayInfo CreateTiles(List<string> images, int width, TrickplayOptions options, string outputDir);
+ TrickplayInfo CreateTiles(IReadOnlyList<string> images, int width, TrickplayOptions options, string outputDir);
/// <summary>
/// Get available trickplay resolutions and corresponding info.
@@ -43,6 +44,12 @@ public interface ITrickplayManager
Task<Dictionary<int, TrickplayInfo>> GetTrickplayResolutions(Guid itemId);
/// <summary>
+ /// Gets the item ids of all items with trickplay info.
+ /// </summary>
+ /// <returns>The list of item ids that have trickplay info.</returns>
+ public Task<IReadOnlyList<Guid>> GetTrickplayItemsAsync();
+
+ /// <summary>
/// Saves trickplay info.
/// </summary>
/// <param name="info">The trickplay info.</param>
@@ -62,8 +69,29 @@ public interface ITrickplayManager
/// <param name="item">The item.</param>
/// <param name="width">The width of a single thumbnail.</param>
/// <param name="index">The tile's index.</param>
+ /// <param name="saveWithMedia">Whether or not the tile should be saved next to the media file.</param>
+ /// <returns>The absolute path.</returns>
+ Task<string> GetTrickplayTilePathAsync(BaseItem item, int width, int index, bool saveWithMedia);
+
+ /// <summary>
+ /// Gets the path to a trickplay tile image.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ /// <param name="tileWidth">The amount of images for the tile width.</param>
+ /// <param name="tileHeight">The amount of images for the tile height.</param>
+ /// <param name="width">The width of a single thumbnail.</param>
+ /// <param name="saveWithMedia">Whether or not the tile should be saved next to the media file.</param>
/// <returns>The absolute path.</returns>
- string GetTrickplayTilePath(BaseItem item, int width, int index);
+ string GetTrickplayDirectory(BaseItem item, int tileWidth, int tileHeight, int width, bool saveWithMedia = false);
+
+ /// <summary>
+ /// Migrates trickplay images between local and media directories.
+ /// </summary>
+ /// <param name="video">The video.</param>
+ /// <param name="libraryOptions">The library options.</param>
+ /// <param name="cancellationToken">CancellationToken to use for operation.</param>
+ /// <returns>Task.</returns>
+ Task MoveGeneratedTrickplayDataAsync(Video video, LibraryOptions? libraryOptions, CancellationToken cancellationToken);
/// <summary>
/// Gets the trickplay HLS playlist.