mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-02 22:08:27 +01:00
Merge remote-tracking branch 'origin/master' into feature/EFUserData
This commit is contained in:
@@ -17,7 +17,6 @@ namespace Emby.Server.Implementations
|
||||
{ DefaultRedirectKey, "web/" },
|
||||
{ FfmpegProbeSizeKey, "1G" },
|
||||
{ FfmpegAnalyzeDurationKey, "200M" },
|
||||
{ PlaylistsAllowDuplicatesKey, bool.FalseString },
|
||||
{ BindToUnixSocketKey, bool.FalseString },
|
||||
{ SqliteCacheSizeKey, "20000" },
|
||||
{ FfmpegSkipValidationKey, bool.FalseString },
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Emby.Server.Implementations.Library.Resolvers
|
||||
{
|
||||
if (args.IsDirectory)
|
||||
{
|
||||
// It's a boxset if the path is a directory with [playlist] in its name
|
||||
// It's a playlist if the path is a directory with [playlist] in its name
|
||||
var filename = Path.GetFileName(Path.TrimEndingDirectorySeparator(args.Path));
|
||||
if (string.IsNullOrEmpty(filename))
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"AppDeviceValues": "앱: {0}, 장치: {1}",
|
||||
"Application": "애플리케이션",
|
||||
"Artists": "아티스트",
|
||||
"AuthenticationSucceededWithUserName": "{0}이(가) 성공적으로 인증됨",
|
||||
"AuthenticationSucceededWithUserName": "{0} 사용자가 성공적으로 인증됨",
|
||||
"Books": "도서",
|
||||
"CameraImageUploadedFrom": "{0}에서 새로운 카메라 이미지가 업로드됨",
|
||||
"Channels": "채널",
|
||||
@@ -70,7 +70,7 @@
|
||||
"ScheduledTaskFailedWithName": "{0} 실패",
|
||||
"ScheduledTaskStartedWithName": "{0} 시작",
|
||||
"ServerNameNeedsToBeRestarted": "{0}를 재시작해야합니다",
|
||||
"Shows": "쇼",
|
||||
"Shows": "시리즈",
|
||||
"Songs": "노래",
|
||||
"StartupEmbyServerIsLoading": "Jellyfin 서버를 불러오고 있습니다. 잠시 후에 다시 시도하십시오.",
|
||||
"SubtitleDownloadFailureForItem": "Subtitles failed to download for {0}",
|
||||
@@ -81,14 +81,14 @@
|
||||
"User": "사용자",
|
||||
"UserCreatedWithName": "사용자 {0} 생성됨",
|
||||
"UserDeletedWithName": "사용자 {0} 삭제됨",
|
||||
"UserDownloadingItemWithValues": "{0}이(가) {1}을 다운로드 중입니다",
|
||||
"UserLockedOutWithName": "유저 {0} 은(는) 잠금처리 되었습니다",
|
||||
"UserOfflineFromDevice": "{1}에서 {0}의 연결이 끊킴",
|
||||
"UserOnlineFromDevice": "{0}이 {1}으로 접속",
|
||||
"UserPasswordChangedWithName": "사용자 {0}의 비밀번호가 변경되었습니다",
|
||||
"UserPolicyUpdatedWithName": "{0}의 사용자 정책이 업데이트되었습니다",
|
||||
"UserStartedPlayingItemWithValues": "{2}에서 {0}이 {1} 재생 중",
|
||||
"UserStoppedPlayingItemWithValues": "{2}에서 {0}이 {1} 재생을 마침",
|
||||
"UserDownloadingItemWithValues": "{0} 사용자가 {1} 다운로드 중",
|
||||
"UserLockedOutWithName": "{0} 사용자 잠김",
|
||||
"UserOfflineFromDevice": "{0} 사용자의 {1}에서 연결이 끊김",
|
||||
"UserOnlineFromDevice": "{0} 사용자가 {1}에서 접속함",
|
||||
"UserPasswordChangedWithName": "{0} 사용자 비밀번호 변경됨",
|
||||
"UserPolicyUpdatedWithName": "{0} 사용자 정책 업데이트됨",
|
||||
"UserStartedPlayingItemWithValues": "{0} 사용자의 {2}에서 {1} 재생 중",
|
||||
"UserStoppedPlayingItemWithValues": "{0} 사용자의 {2}에서 {1} 재생을 마침",
|
||||
"ValueHasBeenAddedToLibrary": "{0}가 미디어 라이브러리에 추가되었습니다",
|
||||
"ValueSpecialEpisodeName": "스페셜 - {0}",
|
||||
"VersionNumber": "버전 {0}",
|
||||
|
||||
@@ -216,14 +216,11 @@ namespace Emby.Server.Implementations.Playlists
|
||||
var newItems = GetPlaylistItems(newItemIds, user, options)
|
||||
.Where(i => i.SupportsAddingToPlaylist);
|
||||
|
||||
// Filter out duplicate items, if necessary
|
||||
if (!_appConfig.DoPlaylistsAllowDuplicates())
|
||||
{
|
||||
var existingIds = playlist.LinkedChildren.Select(c => c.ItemId).ToHashSet();
|
||||
newItems = newItems
|
||||
.Where(i => !existingIds.Contains(i.Id))
|
||||
.Distinct();
|
||||
}
|
||||
// Filter out duplicate items
|
||||
var existingIds = playlist.LinkedChildren.Select(c => c.ItemId).ToHashSet();
|
||||
newItems = newItems
|
||||
.Where(i => !existingIds.Contains(i.Id))
|
||||
.Distinct();
|
||||
|
||||
// Create a list of the new linked children to add to the playlist
|
||||
var childrenToAdd = newItems
|
||||
@@ -269,7 +266,7 @@ namespace Emby.Server.Implementations.Playlists
|
||||
|
||||
var idList = entryIds.ToList();
|
||||
|
||||
var removals = children.Where(i => idList.Contains(i.Item1.Id));
|
||||
var removals = children.Where(i => idList.Contains(i.Item1.ItemId?.ToString("N", CultureInfo.InvariantCulture)));
|
||||
|
||||
playlist.LinkedChildren = children.Except(removals)
|
||||
.Select(i => i.Item1)
|
||||
@@ -286,26 +283,39 @@ namespace Emby.Server.Implementations.Playlists
|
||||
RefreshPriority.High);
|
||||
}
|
||||
|
||||
public async Task MoveItemAsync(string playlistId, string entryId, int newIndex)
|
||||
public async Task MoveItemAsync(string playlistId, string entryId, int newIndex, Guid callingUserId)
|
||||
{
|
||||
if (_libraryManager.GetItemById(playlistId) is not Playlist playlist)
|
||||
{
|
||||
throw new ArgumentException("No Playlist exists with the supplied Id");
|
||||
}
|
||||
|
||||
var user = _userManager.GetUserById(callingUserId);
|
||||
var children = playlist.GetManageableItems().ToList();
|
||||
var accessibleChildren = children.Where(c => c.Item2.IsVisible(user)).ToArray();
|
||||
|
||||
var oldIndex = children.FindIndex(i => string.Equals(entryId, i.Item1.Id, StringComparison.OrdinalIgnoreCase));
|
||||
var oldIndexAll = children.FindIndex(i => string.Equals(entryId, i.Item1.ItemId?.ToString("N", CultureInfo.InvariantCulture), StringComparison.OrdinalIgnoreCase));
|
||||
var oldIndexAccessible = accessibleChildren.FindIndex(i => string.Equals(entryId, i.Item1.ItemId?.ToString("N", CultureInfo.InvariantCulture), StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (oldIndex == newIndex)
|
||||
if (oldIndexAccessible == newIndex)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var item = playlist.LinkedChildren[oldIndex];
|
||||
var newPriorItemIndex = newIndex > oldIndexAccessible ? newIndex : newIndex - 1 < 0 ? 0 : newIndex - 1;
|
||||
var newPriorItemId = accessibleChildren[newPriorItemIndex].Item1.ItemId;
|
||||
var newPriorItemIndexOnAllChildren = children.FindIndex(c => c.Item1.ItemId.Equals(newPriorItemId));
|
||||
var adjustedNewIndex = newPriorItemIndexOnAllChildren + 1;
|
||||
|
||||
var item = playlist.LinkedChildren.FirstOrDefault(i => string.Equals(entryId, i.ItemId?.ToString("N", CultureInfo.InvariantCulture), StringComparison.OrdinalIgnoreCase));
|
||||
if (item is null)
|
||||
{
|
||||
_logger.LogWarning("Modified item not found in playlist. ItemId: {ItemId}, PlaylistId: {PlaylistId}", item.ItemId, playlistId);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var newList = playlist.LinkedChildren.ToList();
|
||||
|
||||
newList.Remove(item);
|
||||
|
||||
if (newIndex >= newList.Count)
|
||||
@@ -314,7 +324,7 @@ namespace Emby.Server.Implementations.Playlists
|
||||
}
|
||||
else
|
||||
{
|
||||
newList.Insert(newIndex, item);
|
||||
newList.Insert(adjustedNewIndex, item);
|
||||
}
|
||||
|
||||
playlist.LinkedChildren = [.. newList];
|
||||
|
||||
Reference in New Issue
Block a user