mirror of https://github.com/jellyfin/jellyfin.git
commit
1b0b7ac6a5
|
@ -10,6 +10,8 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using MediaBrowser.Controller.Entities.Audio;
|
||||||
|
using MediaBrowser.Controller.LiveTv;
|
||||||
|
|
||||||
namespace MediaBrowser.Server.Implementations.EntryPoints
|
namespace MediaBrowser.Server.Implementations.EntryPoints
|
||||||
{
|
{
|
||||||
|
@ -260,12 +262,17 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
|
||||||
|
|
||||||
private bool FilterItem(BaseItem item)
|
private bool FilterItem(BaseItem item)
|
||||||
{
|
{
|
||||||
if (item.LocationType == LocationType.Virtual)
|
if (!item.IsFolder && item.LocationType == LocationType.Virtual)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return !(item is IChannelItem);
|
if (item is IItemByName && !(item is MusicArtist))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return !(item is IChannelItem) && !(item is ILiveTvItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -22,6 +22,8 @@ using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using MediaBrowser.Controller.Channels;
|
||||||
|
using MediaBrowser.Controller.LiveTv;
|
||||||
|
|
||||||
namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
|
namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
|
||||||
{
|
{
|
||||||
|
@ -77,9 +79,9 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
|
||||||
_appHost.HasPendingRestartChanged += _appHost_HasPendingRestartChanged;
|
_appHost.HasPendingRestartChanged += _appHost_HasPendingRestartChanged;
|
||||||
_appHost.HasUpdateAvailableChanged += _appHost_HasUpdateAvailableChanged;
|
_appHost.HasUpdateAvailableChanged += _appHost_HasUpdateAvailableChanged;
|
||||||
_appHost.ApplicationUpdated += _appHost_ApplicationUpdated;
|
_appHost.ApplicationUpdated += _appHost_ApplicationUpdated;
|
||||||
_deviceManager.CameraImageUploaded +=_deviceManager_CameraImageUploaded;
|
_deviceManager.CameraImageUploaded += _deviceManager_CameraImageUploaded;
|
||||||
|
|
||||||
_userManager.UserLockedOut += _userManager_UserLockedOut;
|
_userManager.UserLockedOut += _userManager_UserLockedOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
async void _userManager_UserLockedOut(object sender, GenericEventArgs<User> e)
|
async void _userManager_UserLockedOut(object sender, GenericEventArgs<User> e)
|
||||||
|
@ -311,23 +313,40 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
|
||||||
private readonly List<BaseItem> _itemsAdded = new List<BaseItem>();
|
private readonly List<BaseItem> _itemsAdded = new List<BaseItem>();
|
||||||
void _libraryManager_ItemAdded(object sender, ItemChangeEventArgs e)
|
void _libraryManager_ItemAdded(object sender, ItemChangeEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Item.LocationType == LocationType.FileSystem && !e.Item.IsFolder)
|
if (!FilterItem(e.Item))
|
||||||
{
|
{
|
||||||
lock (_libraryChangedSyncLock)
|
return;
|
||||||
{
|
|
||||||
if (LibraryUpdateTimer == null)
|
|
||||||
{
|
|
||||||
LibraryUpdateTimer = new Timer(LibraryUpdateTimerCallback, null, 5000,
|
|
||||||
Timeout.Infinite);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LibraryUpdateTimer.Change(5000, Timeout.Infinite);
|
|
||||||
}
|
|
||||||
|
|
||||||
_itemsAdded.Add(e.Item);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lock (_libraryChangedSyncLock)
|
||||||
|
{
|
||||||
|
if (LibraryUpdateTimer == null)
|
||||||
|
{
|
||||||
|
LibraryUpdateTimer = new Timer(LibraryUpdateTimerCallback, null, 5000,
|
||||||
|
Timeout.Infinite);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LibraryUpdateTimer.Change(5000, Timeout.Infinite);
|
||||||
|
}
|
||||||
|
|
||||||
|
_itemsAdded.Add(e.Item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool FilterItem(BaseItem item)
|
||||||
|
{
|
||||||
|
if (!item.IsFolder && item.LocationType == LocationType.Virtual)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item is IItemByName && !(item is MusicArtist))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return !(item is IChannelItem) && !(item is ILiveTvItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void LibraryUpdateTimerCallback(object state)
|
private async void LibraryUpdateTimerCallback(object state)
|
||||||
|
|
|
@ -82,7 +82,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
|
||||||
UserAgent = UserAgent,
|
UserAgent = UserAgent,
|
||||||
CancellationToken = cancellationToken,
|
CancellationToken = cancellationToken,
|
||||||
// The data can be large so give it some extra time
|
// The data can be large so give it some extra time
|
||||||
TimeoutMs = 60000,
|
TimeoutMs = 120000,
|
||||||
LogErrorResponseBody = true
|
LogErrorResponseBody = true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue