mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-06 10:16:18 +00:00
update windows ffmpeg
This commit is contained in:
@@ -499,6 +499,16 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||
}
|
||||
}
|
||||
|
||||
if (fields.Contains(ItemFields.CumulativeRunTimeTicks))
|
||||
{
|
||||
dto.CumulativeRunTimeTicks = dto.RunTimeTicks;
|
||||
}
|
||||
|
||||
if (fields.Contains(ItemFields.DateLastMediaAdded))
|
||||
{
|
||||
dto.DateLastMediaAdded = folder.DateLastMediaAdded;
|
||||
}
|
||||
|
||||
dto.UserData.Played = dto.UserData.PlayedPercentage.HasValue && dto.UserData.PlayedPercentage.Value >= 100;
|
||||
}
|
||||
|
||||
@@ -1613,9 +1623,7 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||
{
|
||||
var recursiveItemCount = 0;
|
||||
var unplayed = 0;
|
||||
long runtime = 0;
|
||||
|
||||
DateTime? dateLastMediaAdded = null;
|
||||
double totalPercentPlayed = 0;
|
||||
double totalSyncPercent = 0;
|
||||
var addSyncInfo = fields.Contains(ItemFields.SyncInfo);
|
||||
@@ -1632,15 +1640,6 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||
// Loop through each recursive child
|
||||
foreach (var child in children)
|
||||
{
|
||||
if (!dateLastMediaAdded.HasValue)
|
||||
{
|
||||
dateLastMediaAdded = child.DateCreated;
|
||||
}
|
||||
else
|
||||
{
|
||||
dateLastMediaAdded = new[] { dateLastMediaAdded.Value, child.DateCreated }.Max();
|
||||
}
|
||||
|
||||
var userdata = _userDataRepository.GetUserData(user, child);
|
||||
|
||||
recursiveItemCount++;
|
||||
@@ -1669,8 +1668,6 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||
unplayed++;
|
||||
}
|
||||
|
||||
runtime += child.RunTimeTicks ?? 0;
|
||||
|
||||
if (addSyncInfo)
|
||||
{
|
||||
double percent = 0;
|
||||
@@ -1709,16 +1706,6 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (runtime > 0 && fields.Contains(ItemFields.CumulativeRunTimeTicks))
|
||||
{
|
||||
dto.CumulativeRunTimeTicks = runtime;
|
||||
}
|
||||
|
||||
if (fields.Contains(ItemFields.DateLastMediaAdded))
|
||||
{
|
||||
dto.DateLastMediaAdded = dateLastMediaAdded;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1354,12 +1354,20 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
AddUserToQuery(query, query.User);
|
||||
}
|
||||
|
||||
var initialResult = ItemRepository.GetItemIds(query);
|
||||
if (query.EnableTotalRecordCount)
|
||||
{
|
||||
var initialResult = ItemRepository.GetItemIds(query);
|
||||
|
||||
return new QueryResult<BaseItem>
|
||||
{
|
||||
TotalRecordCount = initialResult.TotalRecordCount,
|
||||
Items = initialResult.Items.Select(GetItemById).Where(i => i != null).ToArray()
|
||||
};
|
||||
}
|
||||
|
||||
return new QueryResult<BaseItem>
|
||||
{
|
||||
TotalRecordCount = initialResult.TotalRecordCount,
|
||||
Items = initialResult.Items.Select(GetItemById).Where(i => i != null).ToArray()
|
||||
Items = ItemRepository.GetItemIdsList(query).Select(GetItemById).Where(i => i != null).ToArray()
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -760,7 +760,14 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||
if (info.IsMovie)
|
||||
{
|
||||
var customRecordingPath = config.MovieRecordingPath;
|
||||
if ((string.IsNullOrWhiteSpace(customRecordingPath) || string.Equals(customRecordingPath, recordPath, StringComparison.OrdinalIgnoreCase)) && config.EnableRecordingSubfolders)
|
||||
var allowSubfolder = true;
|
||||
if (!string.IsNullOrWhiteSpace(customRecordingPath))
|
||||
{
|
||||
allowSubfolder = string.Equals(customRecordingPath, recordPath, StringComparison.OrdinalIgnoreCase);
|
||||
recordPath = customRecordingPath;
|
||||
}
|
||||
|
||||
if (allowSubfolder && config.EnableRecordingSubfolders)
|
||||
{
|
||||
recordPath = Path.Combine(recordPath, "Movies");
|
||||
}
|
||||
@@ -775,7 +782,14 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||
else if (info.IsSeries)
|
||||
{
|
||||
var customRecordingPath = config.SeriesRecordingPath;
|
||||
if ((string.IsNullOrWhiteSpace(customRecordingPath) || string.Equals(customRecordingPath, recordPath, StringComparison.OrdinalIgnoreCase)) && config.EnableRecordingSubfolders)
|
||||
var allowSubfolder = true;
|
||||
if (!string.IsNullOrWhiteSpace(customRecordingPath))
|
||||
{
|
||||
allowSubfolder = string.Equals(customRecordingPath, recordPath, StringComparison.OrdinalIgnoreCase);
|
||||
recordPath = customRecordingPath;
|
||||
}
|
||||
|
||||
if (allowSubfolder && config.EnableRecordingSubfolders)
|
||||
{
|
||||
recordPath = Path.Combine(recordPath, "Series");
|
||||
}
|
||||
|
||||
@@ -886,7 +886,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
StartIndex = query.StartIndex,
|
||||
Limit = query.Limit,
|
||||
SortBy = query.SortBy,
|
||||
SortOrder = query.SortOrder ?? SortOrder.Ascending
|
||||
SortOrder = query.SortOrder ?? SortOrder.Ascending,
|
||||
EnableTotalRecordCount = query.EnableTotalRecordCount
|
||||
};
|
||||
|
||||
if (query.HasAired.HasValue)
|
||||
@@ -924,7 +925,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
IsAiring = query.IsAiring,
|
||||
IsMovie = query.IsMovie,
|
||||
IsSports = query.IsSports,
|
||||
IsKids = query.IsKids
|
||||
IsKids = query.IsKids,
|
||||
EnableTotalRecordCount = query.EnableTotalRecordCount
|
||||
};
|
||||
|
||||
if (query.HasAired.HasValue)
|
||||
@@ -1263,11 +1265,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
|
||||
private async Task CleanDatabaseInternal(List<Guid> currentIdList, string[] validTypes, IProgress<double> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
var list = _itemRepo.GetItemIds(new InternalItemsQuery
|
||||
var list = _itemRepo.GetItemIdsList(new InternalItemsQuery
|
||||
{
|
||||
IncludeItemTypes = validTypes
|
||||
|
||||
}).Items.ToList();
|
||||
}).ToList();
|
||||
|
||||
var numComplete = 0;
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
private IDbCommand _updateInheritedRatingCommand;
|
||||
private IDbCommand _updateInheritedTagsCommand;
|
||||
|
||||
public const int LatestSchemaVersion = 76;
|
||||
public const int LatestSchemaVersion = 77;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
|
||||
@@ -235,6 +235,9 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
_connection.AddColumn(Logger, "TypedBaseItems", "SlugName", "Text");
|
||||
_connection.AddColumn(Logger, "TypedBaseItems", "OriginalTitle", "Text");
|
||||
_connection.AddColumn(Logger, "TypedBaseItems", "PrimaryVersionId", "Text");
|
||||
_connection.AddColumn(Logger, "TypedBaseItems", "DateLastMediaAdded", "DATETIME");
|
||||
_connection.AddColumn(Logger, "TypedBaseItems", "Album", "Text");
|
||||
|
||||
_connection.AddColumn(Logger, "UserDataKeys", "Priority", "INT");
|
||||
|
||||
string[] postQueries =
|
||||
@@ -351,7 +354,9 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
"TrailerTypes",
|
||||
"DateModifiedDuringLastRefresh",
|
||||
"OriginalTitle",
|
||||
"PrimaryVersionId"
|
||||
"PrimaryVersionId",
|
||||
"DateLastMediaAdded",
|
||||
"Album"
|
||||
};
|
||||
|
||||
private readonly string[] _mediaStreamSaveColumns =
|
||||
@@ -463,7 +468,9 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
"PresentationUniqueKey",
|
||||
"SlugName",
|
||||
"OriginalTitle",
|
||||
"PrimaryVersionId"
|
||||
"PrimaryVersionId",
|
||||
"DateLastMediaAdded",
|
||||
"Album"
|
||||
};
|
||||
_saveItemCommand = _connection.CreateCommand();
|
||||
_saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values (";
|
||||
@@ -824,6 +831,18 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
_saveItemCommand.GetParameter(index++).Value = null;
|
||||
}
|
||||
|
||||
var folder = item as Folder;
|
||||
if (folder != null && folder.DateLastMediaAdded.HasValue)
|
||||
{
|
||||
_saveItemCommand.GetParameter(index++).Value = folder.DateLastMediaAdded.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
_saveItemCommand.GetParameter(index++).Value = null;
|
||||
}
|
||||
|
||||
_saveItemCommand.GetParameter(index++).Value = item.Album;
|
||||
|
||||
_saveItemCommand.Transaction = transaction;
|
||||
|
||||
_saveItemCommand.ExecuteNonQuery();
|
||||
@@ -1217,6 +1236,17 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
}
|
||||
}
|
||||
|
||||
var folder = item as Folder;
|
||||
if (folder != null && !reader.IsDBNull(54))
|
||||
{
|
||||
folder.DateLastMediaAdded = reader.GetDateTime(54).ToUniversalTime();
|
||||
}
|
||||
|
||||
if (!reader.IsDBNull(55))
|
||||
{
|
||||
item.Album = reader.GetString(55);
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -1777,6 +1807,10 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
{
|
||||
return new Tuple<string, bool>("played", false);
|
||||
}
|
||||
if (string.Equals(name, ItemSortBy.DateLastContentAdded, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return new Tuple<string, bool>("DateLastMediaAdded", false);
|
||||
}
|
||||
|
||||
return new Tuple<string, bool>(name, false);
|
||||
}
|
||||
@@ -2484,7 +2518,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
if (query.MediaTypes.Length == 1)
|
||||
{
|
||||
whereClauses.Add("MediaType=@MediaTypes");
|
||||
cmd.Parameters.Add(cmd, "@MediaTypes", DbType.String).Value = query.MediaTypes[0].ToString();
|
||||
cmd.Parameters.Add(cmd, "@MediaTypes", DbType.String).Value = query.MediaTypes[0];
|
||||
}
|
||||
if (query.MediaTypes.Length > 1)
|
||||
{
|
||||
@@ -2493,6 +2527,26 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
whereClauses.Add("MediaType in (" + val + ")");
|
||||
}
|
||||
|
||||
if (query.AlbumNames.Length > 0)
|
||||
{
|
||||
var clause = "(";
|
||||
|
||||
var index = 0;
|
||||
foreach (var name in query.AlbumNames)
|
||||
{
|
||||
if (index > 0)
|
||||
{
|
||||
clause += " OR ";
|
||||
}
|
||||
clause += "Album=@AlbumName" + index;
|
||||
index++;
|
||||
cmd.Parameters.Add(cmd, "@AlbumName" + index, DbType.String).Value = name;
|
||||
}
|
||||
|
||||
clause += ")";
|
||||
whereClauses.Add(clause);
|
||||
}
|
||||
|
||||
//var enableItemsByName = query.IncludeItemsByName ?? query.IncludeItemTypes.Length > 0;
|
||||
var enableItemsByName = query.IncludeItemsByName ?? false;
|
||||
|
||||
|
||||
@@ -49,10 +49,10 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
||||
|
||||
if (folder != null)
|
||||
{
|
||||
return folder.GetRecursiveChildren(User, i => !i.IsFolder)
|
||||
.Select(i => i.DateCreated)
|
||||
.OrderByDescending(i => i)
|
||||
.FirstOrDefault();
|
||||
if (folder.DateLastMediaAdded.HasValue)
|
||||
{
|
||||
return folder.DateLastMediaAdded.Value;
|
||||
}
|
||||
}
|
||||
|
||||
return x.DateCreated;
|
||||
|
||||
Reference in New Issue
Block a user