forked from MediaBrowser/Emby
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reworked library refresh implementation #2
Library update requests are now grouped by parent folders. These requests are now also timed individually. As soon as a child file is changed, the group delay timer gets reset for the whole group. But: Other folders are no longer affected (like before) but instead handled independently.
- Loading branch information
Showing
5 changed files
with
277 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
MediaBrowser.Server.Implementations/IO/LibraryUpdateEventArgs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace MediaBrowser.Server.Implementations.IO | ||
{ | ||
class LibraryUpdateEventArgs : EventArgs | ||
{ | ||
private LibraryUpdateItem _item; | ||
|
||
public bool Cancel { get; set; } | ||
|
||
public LibraryUpdateItem Item { get { return _item; }} | ||
|
||
public LibraryUpdateEventArgs(LibraryUpdateItem item) | ||
{ | ||
_item = item; | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
MediaBrowser.Server.Implementations/IO/LibraryUpdateItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Collections.Concurrent; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace MediaBrowser.Server.Implementations.IO | ||
{ | ||
class LibraryUpdateItem | ||
{ | ||
private ConcurrentDictionary<string, string> _filePaths = new ConcurrentDictionary<string, string>(); | ||
private string _folder; | ||
|
||
public LibraryUpdateItem(string folder) | ||
{ | ||
_folder = folder; | ||
} | ||
|
||
public DateTime DueDate { get; set; } | ||
|
||
public string Folder { get { return _folder; } } | ||
|
||
public ConcurrentDictionary<string, string> FilePaths { get { return _filePaths; } } | ||
} | ||
} |
Oops, something went wrong.