mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 17:14:42 +01:00
fix double path concatenation
This commit is contained in:
@@ -868,6 +868,19 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||
}
|
||||
}
|
||||
|
||||
// If there is no thumb, indicate what parent has one in case the Ui wants to allow inheritance
|
||||
if (!dto.HasThumb)
|
||||
{
|
||||
var parentWithImage = GetParentImageItem(item, ImageType.Thumb, owner);
|
||||
|
||||
if (parentWithImage != null)
|
||||
{
|
||||
dto.ParentThumbItemId = GetDtoId(parentWithImage);
|
||||
|
||||
dto.ParentThumbImageTag = GetImageCacheTag(parentWithImage, ImageType.Thumb, parentWithImage.GetImage(ImageType.Thumb));
|
||||
}
|
||||
}
|
||||
|
||||
if (fields.Contains(ItemFields.Path))
|
||||
{
|
||||
dto.Path = item.Path;
|
||||
@@ -1022,6 +1035,13 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||
|
||||
dto.SeriesId = GetDtoId(series);
|
||||
dto.SeriesName = series.Name;
|
||||
dto.AirTime = series.AirTime;
|
||||
dto.SeriesStudio = series.Studios.FirstOrDefault();
|
||||
|
||||
if (series.HasImage(ImageType.Thumb))
|
||||
{
|
||||
dto.SeriesThumbImageTag = GetImageCacheTag(series, ImageType.Thumb, series.GetImage(ImageType.Thumb));
|
||||
}
|
||||
}
|
||||
|
||||
// Add SeasonInfo
|
||||
@@ -1033,6 +1053,8 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||
|
||||
dto.SeriesId = GetDtoId(series);
|
||||
dto.SeriesName = series.Name;
|
||||
dto.AirTime = series.AirTime;
|
||||
dto.SeriesStudio = series.Studios.FirstOrDefault();
|
||||
}
|
||||
|
||||
var game = item as Game;
|
||||
|
||||
@@ -186,6 +186,7 @@
|
||||
</Compile>
|
||||
<Compile Include="Session\SessionWebSocketListener.cs" />
|
||||
<Compile Include="Session\WebSocketController.cs" />
|
||||
<Compile Include="Sorting\AirTimeComparer.cs" />
|
||||
<Compile Include="Sorting\AlbumArtistComparer.cs" />
|
||||
<Compile Include="Sorting\AlbumComparer.cs" />
|
||||
<Compile Include="Sorting\AlbumCountComparer.cs" />
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Sorting;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Sorting
|
||||
{
|
||||
public class AirTimeComparer : IBaseItemComparer
|
||||
{
|
||||
/// <summary>
|
||||
/// Compares the specified x.
|
||||
/// </summary>
|
||||
/// <param name="x">The x.</param>
|
||||
/// <param name="y">The y.</param>
|
||||
/// <returns>System.Int32.</returns>
|
||||
public int Compare(BaseItem x, BaseItem y)
|
||||
{
|
||||
return DateTime.Compare(GetValue(x), GetValue(y));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value.
|
||||
/// </summary>
|
||||
/// <param name="x">The x.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
private DateTime GetValue(BaseItem x)
|
||||
{
|
||||
var series = (x as Series) ?? x.FindParent<Series>();
|
||||
|
||||
DateTime result;
|
||||
if (series != null && DateTime.TryParse(series.AirTime, out result))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
return DateTime.MinValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public string Name
|
||||
{
|
||||
get { return ItemSortBy.AirTime; }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user