aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Sync/ISyncDataProvider.cs
blob: ebff50cb025f6a6f508266b61643435ec8c74625 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using MediaBrowser.Model.Sync;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace MediaBrowser.Controller.Sync
{
    public interface ISyncDataProvider
    {
        /// <summary>
        /// Gets the local items.
        /// </summary>
        /// <param name="target">The target.</param>
        /// <param name="serverId">The server identifier.</param>
        /// <returns>Task&lt;List&lt;LocalItem&gt;&gt;.</returns>
        Task<List<LocalItem>> GetLocalItems(SyncTarget target, string serverId);

        /// <summary>
        /// Adds the or update.
        /// </summary>
        /// <param name="target">The target.</param>
        /// <param name="item">The item.</param>
        /// <returns>Task.</returns>
        Task AddOrUpdate(SyncTarget target, LocalItem item);

        /// <summary>
        /// Deletes the specified identifier.
        /// </summary>
        /// <param name="target">The target.</param>
        /// <param name="id">The identifier.</param>
        /// <returns>Task.</returns>
        Task Delete(SyncTarget target, string id);

        /// <summary>
        /// Gets the specified identifier.
        /// </summary>
        /// <param name="target">The target.</param>
        /// <param name="id">The identifier.</param>
        /// <returns>Task&lt;LocalItem&gt;.</returns>
        Task<LocalItem> Get(SyncTarget target, string id);

        /// <summary>
        /// Gets the cached item.
        /// </summary>
        /// <param name="target">The target.</param>
        /// <param name="serverId">The server identifier.</param>
        /// <param name="itemId">The item identifier.</param>
        /// <returns>Task&lt;LocalItem&gt;.</returns>
        Task<List<LocalItem>> GetItems(SyncTarget target, string serverId, string itemId);
        /// <summary>
        /// Gets the cached items by synchronize job item identifier.
        /// </summary>
        /// <param name="target">The target.</param>
        /// <param name="serverId">The server identifier.</param>
        /// <param name="syncJobItemId">The synchronize job item identifier.</param>
        /// <returns>Task&lt;List&lt;LocalItem&gt;&gt;.</returns>
        Task<List<LocalItem>> GetItemsBySyncJobItemId(SyncTarget target, string serverId, string syncJobItemId);
    }
}