mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-14 11:23:42 +02:00
New: Add option to import from any user's personal list
This commit is contained in:
parent
1e99856ffc
commit
d6e5d9c424
@ -26,17 +26,18 @@ public virtual ImportListPageableRequestChain GetListItems()
|
||||
private IEnumerable<ImportListRequest> GetSeriesRequest()
|
||||
{
|
||||
var link = Settings.BaseUrl.Trim();
|
||||
var userName = Settings.Username.IsNotNullOrWhiteSpace() ? Settings.Username.Trim() : Settings.AuthUser.Trim();
|
||||
|
||||
switch (Settings.TraktListType)
|
||||
{
|
||||
case (int)TraktUserListType.UserWatchList:
|
||||
link += $"/users/{Settings.AuthUser.Trim()}/watchlist/shows?limit={Settings.Limit}";
|
||||
link += $"/users/{userName}/watchlist/shows?limit={Settings.Limit}";
|
||||
break;
|
||||
case (int)TraktUserListType.UserWatchedList:
|
||||
link += $"/users/{Settings.AuthUser.Trim()}/watched/shows?limit={Settings.Limit}";
|
||||
link += $"/users/{userName}/watched/shows?limit={Settings.Limit}";
|
||||
break;
|
||||
case (int)TraktUserListType.UserCollectionList:
|
||||
link += $"/users/{Settings.AuthUser.Trim()}/collection/shows?limit={Settings.Limit}";
|
||||
link += $"/users/{userName}/collection/shows?limit={Settings.Limit}";
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -24,5 +24,8 @@ public TraktUserSettings()
|
||||
|
||||
[FieldDefinition(1, Label = "List Type", Type = FieldType.Select, SelectOptions = typeof(TraktUserListType), HelpText = "Type of list you're seeking to import from")]
|
||||
public int TraktListType { get; set; }
|
||||
|
||||
[FieldDefinition(2, Label = "Username", HelpText = "Username for the List to import from (empty to use Auth User)")]
|
||||
public string Username { get; set; }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user