mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-21 01:26:41 +00:00
update active recordings
This commit is contained in:
@@ -432,7 +432,7 @@ namespace MediaBrowser.Model.Dto
|
||||
/// Gets or sets the artists.
|
||||
/// </summary>
|
||||
/// <value>The artists.</value>
|
||||
public List<string> Artists { get; set; }
|
||||
public string[] Artists { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the artist items.
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using MediaBrowser.Model.Extensions;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
@@ -91,19 +90,15 @@ namespace MediaBrowser.Model.Dto
|
||||
return;
|
||||
}
|
||||
|
||||
var internalStreams = MediaStreams
|
||||
.Where(i => !i.IsExternal)
|
||||
.ToList();
|
||||
|
||||
if (internalStreams.Count == 0)
|
||||
var bitrate = 0;
|
||||
foreach (var stream in MediaStreams)
|
||||
{
|
||||
return;
|
||||
if (!stream.IsExternal)
|
||||
{
|
||||
bitrate += stream.BitRate ?? 0;
|
||||
}
|
||||
}
|
||||
|
||||
var bitrate = internalStreams
|
||||
.Select(m => m.BitRate ?? 0)
|
||||
.Sum();
|
||||
|
||||
if (bitrate > 0)
|
||||
{
|
||||
Bitrate = bitrate;
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace MediaBrowser.Model.Extensions
|
||||
{
|
||||
@@ -13,7 +11,14 @@ namespace MediaBrowser.Model.Extensions
|
||||
throw new ArgumentNullException("value");
|
||||
}
|
||||
|
||||
return list.Contains(value, StringComparer.OrdinalIgnoreCase);
|
||||
foreach (var item in list)
|
||||
{
|
||||
if (string.Equals(item, value, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool ContainsAnyIgnoreCase(string[] list, string[] values)
|
||||
|
||||
@@ -58,9 +58,7 @@ namespace MediaBrowser.Model.Services
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
var stringComparison = GetStringComparison();
|
||||
|
||||
var parameters = this.Where(p => string.Equals(key, p.Name, stringComparison)).ToArray();
|
||||
var parameters = GetItems(key);
|
||||
|
||||
foreach (var p in parameters)
|
||||
{
|
||||
@@ -84,14 +82,6 @@ namespace MediaBrowser.Model.Services
|
||||
Add(key, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// True if the collection contains a query parameter with the given name.
|
||||
/// </summary>
|
||||
public bool ContainsKey(string name)
|
||||
{
|
||||
return this.Any(p => p.Name == name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes all parameters of the given name.
|
||||
/// </summary>
|
||||
@@ -106,16 +96,49 @@ namespace MediaBrowser.Model.Services
|
||||
{
|
||||
var stringComparison = GetStringComparison();
|
||||
|
||||
return this.Where(p => string.Equals(p.Name, name, stringComparison))
|
||||
.Select(p => p.Value)
|
||||
.FirstOrDefault();
|
||||
foreach (var pair in this)
|
||||
{
|
||||
if (string.Equals(pair.Name, name, stringComparison))
|
||||
{
|
||||
return pair.Value;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual string[] GetValues(string name)
|
||||
public virtual List<NameValuePair> GetItems(string name)
|
||||
{
|
||||
var stringComparison = GetStringComparison();
|
||||
|
||||
return this.Where(p => string.Equals(p.Name, name, stringComparison)).Select(p => p.Value).ToArray();
|
||||
var list = new List<NameValuePair>();
|
||||
|
||||
foreach (var pair in this)
|
||||
{
|
||||
if (string.Equals(pair.Name, name, stringComparison))
|
||||
{
|
||||
list.Add(pair);
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public virtual List<string> GetValues(string name)
|
||||
{
|
||||
var stringComparison = GetStringComparison();
|
||||
|
||||
var list = new List<string>();
|
||||
|
||||
foreach (var pair in this)
|
||||
{
|
||||
if (string.Equals(pair.Name, name, stringComparison))
|
||||
{
|
||||
list.Add(pair.Value);
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public Dictionary<string, string> ToDictionary()
|
||||
@@ -134,7 +157,17 @@ namespace MediaBrowser.Model.Services
|
||||
|
||||
public IEnumerable<string> Keys
|
||||
{
|
||||
get { return this.Select(i => i.Name); }
|
||||
get
|
||||
{
|
||||
var keys = new string[this.Count];
|
||||
|
||||
for (var i = 0; i < keys.Length; i++)
|
||||
{
|
||||
keys[i] = this[i].Name;
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -89,5 +89,7 @@ namespace MediaBrowser.Model.Updates
|
||||
public string targetFilename { get; set; }
|
||||
|
||||
public string infoUrl { get; set; }
|
||||
|
||||
public string runtimes { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user