mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
New: Add option to import from any Trakt user's personal list
This commit is contained in:
parent
35abd99b3f
commit
ac5736c05b
@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.Notifications.Trakt;
|
||||
|
||||
@ -26,17 +27,18 @@ public virtual ImportListPageableRequestChain GetMovies()
|
||||
private IEnumerable<ImportListRequest> GetMoviesRequest()
|
||||
{
|
||||
var link = string.Empty;
|
||||
var userName = Settings.Username.IsNotNullOrWhiteSpace() ? Settings.Username.Trim() : Settings.AuthUser.Trim();
|
||||
|
||||
switch (Settings.TraktListType)
|
||||
{
|
||||
case (int)TraktUserListType.UserWatchList:
|
||||
link += $"users/{Settings.AuthUser.Trim()}/watchlist/movies?limit={Settings.Limit}";
|
||||
link += $"users/{userName}/watchlist/movies?limit={Settings.Limit}";
|
||||
break;
|
||||
case (int)TraktUserListType.UserWatchedList:
|
||||
link += $"users/{Settings.AuthUser.Trim()}/watched/movies?limit={Settings.Limit}";
|
||||
link += $"users/{userName}/watched/movies?limit={Settings.Limit}";
|
||||
break;
|
||||
case (int)TraktUserListType.UserCollectionList:
|
||||
link += $"users/{Settings.AuthUser.Trim()}/collection/movies?limit={Settings.Limit}";
|
||||
link += $"users/{userName}/collection/movies?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