Compare commits

...

17 Commits

Author SHA1 Message Date
rzk3 b87f1b9407
Merge 1d65d4feff into 5612cb8178 2024-04-25 09:15:44 -04:00
renovate[bot] 5612cb8178
chore(deps): update ci dependencies (#11427)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-25 07:15:31 -06:00
renovate[bot] ccd06bc547
chore(deps): update dependency diacritics to v3.3.29 (#11429)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-25 07:02:45 -06:00
Bond-009 d29b85a134
Fix multiple intro providers and remove unneeded ToLists (#11431) 2024-04-25 07:02:01 -06:00
rzk3 1d65d4feff Fix merge conflict 2023-07-02 20:32:09 -04:00
rzk3 0549b86982 Round PlaybackSpeed to nearest tenth 2023-03-27 10:45:00 -04:00
rzk3 6d13c95e84 Change to float? instead of double? 2023-03-27 10:42:20 -04:00
rzk3 d7c5f12d09 Verify input in PlayQueueUpdate ctor 2023-02-17 21:31:57 -05:00
rzk3 914faa6679 Use ternary conditional operator 2023-02-17 21:29:34 -05:00
rzk3 5161fbc67a Added PlaybackSpeed to Group 2023-02-16 21:50:24 -05:00
rzk3 7b8b310cb5 Added PlaybackRequestType.SetPlaybackSpeed 2023-02-16 21:22:49 -05:00
rzk3 7c1ebc3ea2 Add PlaybackSpeed to PlayQueueUpdates 2023-02-16 21:13:33 -05:00
rzk3 800ff53e97 Use Math.Clamp instead of if statements 2023-02-16 21:12:22 -05:00
rzk3 9c5d08f4d1 Fixed clamped value being replaced 2023-02-16 10:10:34 -05:00
rzk3 750feaf693 Clamp PlaybackSpeed values instead of erroring 2023-02-16 10:04:58 -05:00
rzk3 bb840a2e70 Made PlaybackSpeed nullable for kotlin SDK 2023-02-16 09:27:09 -05:00
rzk3 7c46947df5 Add PlaybackSpeed properties to state APIS 2023-02-16 09:18:26 -05:00
16 changed files with 86 additions and 23 deletions

View File

@ -20,7 +20,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Setup .NET
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0
with:

View File

@ -14,7 +14,7 @@ jobs:
permissions: read-all
steps:
- name: Checkout repository
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
@ -39,7 +39,7 @@ jobs:
permissions: read-all
steps:
- name: Checkout repository
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
@ -78,12 +78,12 @@ jobs:
- openapi-base
steps:
- name: Download openapi-head
uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: openapi-head
path: openapi-head
- name: Download openapi-base
uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: openapi-base
path: openapi-base
@ -152,7 +152,7 @@ jobs:
run: |-
echo "JELLYFIN_VERSION=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
- name: Download openapi-head
uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: openapi-head
path: openapi-head

View File

@ -19,7 +19,7 @@ jobs:
runs-on: "${{ matrix.os }}"
steps:
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0
with:

View File

@ -24,7 +24,7 @@ jobs:
reactions: '+1'
- name: Checkout the latest code
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
token: ${{ secrets.JF_BOT_TOKEN }}
fetch-depth: 0
@ -51,7 +51,7 @@ jobs:
reactions: eyes
- name: Checkout the latest code
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
token: ${{ secrets.JF_BOT_TOKEN }}
fetch-depth: 0
@ -128,7 +128,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: pull in script
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
repository: jellyfin/jellyfin-triage-script
- name: install python

View File

@ -10,7 +10,7 @@ jobs:
issues: write
steps:
- name: pull in script
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
repository: jellyfin/jellyfin-triage-script
- name: install python

View File

@ -33,7 +33,7 @@ jobs:
yq-version: v4.9.8
- name: Checkout Repository
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
ref: ${{ env.TAG_BRANCH }}
@ -66,7 +66,7 @@ jobs:
NEXT_VERSION: ${{ github.event.inputs.NEXT_VERSION }}
steps:
- name: Checkout Repository
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
ref: ${{ env.TAG_BRANCH }}

View File

@ -13,7 +13,7 @@
<PackageVersion Include="BlurHashSharp" Version="1.3.2" />
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="Diacritics" Version="3.3.27" />
<PackageVersion Include="Diacritics" Version="3.3.29" />
<PackageVersion Include="DiscUtils.Udf" Version="0.16.13" />
<PackageVersion Include="DotNet.Glob" Version="3.1.3" />
<PackageVersion Include="EFCoreSecondLevelCacheInterceptor" Version="4.4.3" />

View File

@ -44,7 +44,6 @@ using MediaBrowser.Model.Library;
using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Tasks;
using Microsoft.Extensions.Logging;
using TMDbLib.Objects.Authentication;
using Episode = MediaBrowser.Controller.Entities.TV.Episode;
using EpisodeInfo = Emby.Naming.TV.EpisodeInfo;
using Genre = MediaBrowser.Controller.Entities.Genre;
@ -1612,14 +1611,18 @@ namespace Emby.Server.Implementations.Library
/// <returns>IEnumerable{System.String}.</returns>
public async Task<IEnumerable<Video>> GetIntros(BaseItem item, User user)
{
if (IntroProviders.Length == 0)
{
return [];
}
var tasks = IntroProviders
.Take(1)
.Select(i => GetIntros(i, item, user));
var items = await Task.WhenAll(tasks).ConfigureAwait(false);
return items
.SelectMany(i => i.ToArray())
.SelectMany(i => i)
.Select(ResolveIntro)
.Where(i => i is not null)!; // null values got filtered out
}

View File

@ -274,7 +274,7 @@ namespace Emby.Server.Implementations.Library
var tasks = _providers.Select(i => GetDynamicMediaSources(item, i, cancellationToken));
var results = await Task.WhenAll(tasks).ConfigureAwait(false);
return results.SelectMany(i => i.ToList());
return results.SelectMany(i => i);
}
private async Task<IEnumerable<MediaSourceInfo>> GetDynamicMediaSources(BaseItem item, IMediaSourceProvider provider, CancellationToken cancellationToken)

View File

@ -62,6 +62,11 @@ namespace Emby.Server.Implementations.SyncPlay
/// </summary>
private IGroupState _state;
/// <summary>
/// The internal playback speed.
/// </summary>
private float? _playbackSpeed = 1.0f;
/// <summary>
/// Initializes a new instance of the <see cref="Group" /> class.
/// </summary>
@ -138,6 +143,16 @@ namespace Emby.Server.Implementations.SyncPlay
/// <value>The last activity.</value>
public DateTime LastActivity { get; set; }
/// <summary>
/// Gets or sets the playback speed.
/// </summary>
/// <value>The playback speed.</value>
public float? PlaybackSpeed
{
get => _playbackSpeed;
set => _playbackSpeed = value is null ? null : (float?)Math.Round(Math.Clamp(value.Value, 0.1f, 10.0f), 1);
}
/// <summary>
/// Adds the session to the group.
/// </summary>
@ -679,7 +694,8 @@ namespace Emby.Server.Implementations.SyncPlay
startPositionTicks,
isPlaying,
PlayQueue.ShuffleMode,
PlayQueue.RepeatMode);
PlayQueue.RepeatMode,
PlaybackSpeed);
}
}
}

View File

@ -11,6 +11,8 @@ namespace MediaBrowser.Model.Session
/// </summary>
public class PlaybackProgressInfo
{
private float? _playbackSpeed = 1.0f;
/// <summary>
/// Gets or sets a value indicating whether this instance can seek.
/// </summary>
@ -116,5 +118,15 @@ namespace MediaBrowser.Model.Session
public QueueItem[] NowPlayingQueue { get; set; }
public string PlaylistItemId { get; set; }
/// <summary>
/// Gets or sets the playback speed.
/// </summary>
/// <value>The playback speed.</value>
public float? PlaybackSpeed
{
get => _playbackSpeed;
set => _playbackSpeed = value is null ? null : (float?)Math.Round(Math.Clamp(value.Value, 0.1f, 10.0f), 1);
}
}
}

View File

@ -1,10 +1,14 @@
#nullable disable
#pragma warning disable CS1591
using System;
namespace MediaBrowser.Model.Session
{
public class PlayerStateInfo
{
private float? _playbackSpeed = 1.0f;
/// <summary>
/// Gets or sets the now playing position ticks.
/// </summary>
@ -76,5 +80,15 @@ namespace MediaBrowser.Model.Session
/// </summary>
/// <value>The live stream identifier.</value>
public string LiveStreamId { get; set; }
/// <summary>
/// Gets or sets the playback speed.
/// </summary>
/// <value>The playback speed.</value>
public float? PlaybackSpeed
{
get => _playbackSpeed;
set => _playbackSpeed = value is null ? null : (float?)Math.Round(Math.Clamp(value.Value, 0.1f, 10.0f), 1);
}
}
}

View File

@ -19,7 +19,8 @@ namespace MediaBrowser.Model.SyncPlay
/// <param name="isPlaying">The playing item status.</param>
/// <param name="shuffleMode">The shuffle mode.</param>
/// <param name="repeatMode">The repeat mode.</param>
public PlayQueueUpdate(PlayQueueUpdateReason reason, DateTime lastUpdate, IReadOnlyList<SyncPlayQueueItem> playlist, int playingItemIndex, long startPositionTicks, bool isPlaying, GroupShuffleMode shuffleMode, GroupRepeatMode repeatMode)
/// <param name="playbackSpeed">The playback speed.</param>
public PlayQueueUpdate(PlayQueueUpdateReason reason, DateTime lastUpdate, IReadOnlyList<SyncPlayQueueItem> playlist, int playingItemIndex, long startPositionTicks, bool isPlaying, GroupShuffleMode shuffleMode, GroupRepeatMode repeatMode, float? playbackSpeed)
{
Reason = reason;
LastUpdate = lastUpdate;
@ -29,6 +30,7 @@ namespace MediaBrowser.Model.SyncPlay
IsPlaying = isPlaying;
ShuffleMode = shuffleMode;
RepeatMode = repeatMode;
PlaybackSpeed = playbackSpeed is null ? null : (float?)Math.Round(Math.Clamp(playbackSpeed.Value, 0.1f, 10.0f), 1);
}
/// <summary>
@ -78,5 +80,11 @@ namespace MediaBrowser.Model.SyncPlay
/// </summary>
/// <value>The repeat mode.</value>
public GroupRepeatMode RepeatMode { get; }
/// <summary>
/// Gets the PlaybackSpeed.
/// </summary>
/// <value>The playback speed.</value>
public float? PlaybackSpeed { get; }
}
}

View File

@ -53,6 +53,11 @@ namespace MediaBrowser.Model.SyncPlay
/// <summary>
/// A user is changing shuffle mode.
/// </summary>
ShuffleMode = 9
ShuffleMode = 9,
/// <summary>
/// A user has changed the playback speed.
/// </summary>
PlaybackSpeedChange = 10
}
}

View File

@ -88,6 +88,11 @@ namespace MediaBrowser.Model.SyncPlay
/// <summary>
/// A user is requesting to be ignored on group wait.
/// </summary>
IgnoreWait = 16
IgnoreWait = 16,
/// <summary>
/// A user is requesting to change the playback speed.
/// </summary>
SetPlaybackSpeed = 17
}
}

View File

@ -286,7 +286,7 @@ namespace MediaBrowser.Providers.Manager
var results = await Task.WhenAll(tasks).ConfigureAwait(false);
return results.SelectMany(i => i.ToList());
return results.SelectMany(i => i);
}
/// <summary>