mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-18 20:24:20 +01:00
update direct stream url for improved caching
This commit is contained in:
@@ -5,9 +5,11 @@ using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Controller.Channels;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities.Audio
|
||||
@@ -266,6 +268,11 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
Size = i.Size
|
||||
};
|
||||
|
||||
if (info.Protocol == MediaProtocol.File)
|
||||
{
|
||||
info.ETag = i.DateModified.Ticks.ToString(CultureInfo.InvariantCulture).GetMD5().ToString("N");
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(info.Container))
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(i.Path) && locationType != LocationType.Remote && locationType != LocationType.Virtual)
|
||||
|
||||
@@ -12,6 +12,7 @@ using System.Runtime.Serialization;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using CommonIO;
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Controller.Channels;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
@@ -611,6 +612,11 @@ namespace MediaBrowser.Controller.Entities
|
||||
SupportsDirectStream = i.VideoType == VideoType.VideoFile
|
||||
};
|
||||
|
||||
if (info.Protocol == MediaProtocol.File)
|
||||
{
|
||||
info.ETag = i.DateModified.Ticks.ToString(CultureInfo.InvariantCulture).GetMD5().ToString("N");
|
||||
}
|
||||
|
||||
if (i.IsShortcut)
|
||||
{
|
||||
info.Path = i.ShortcutPath;
|
||||
|
||||
Reference in New Issue
Block a user