mirror of https://github.com/Sonarr/Sonarr
New: Add option to import from any user's personal list
This commit is contained in:
parent
1e99856ffc
commit
d6e5d9c424
|
@ -26,17 +26,18 @@ namespace NzbDrone.Core.ImportLists.Trakt.User
|
|||
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 @@ namespace NzbDrone.Core.ImportLists.Trakt.User
|
|||
|
||||
[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