Esempio n. 1
0
 public async Task <IEnumerable <RadarrRootFolder> > GetRootFolders([FromBody] RadarrSettings settings)
 {
     if (settings.V3)
     {
         return(await _radarrV3Api.GetRootFolders(settings.ApiKey, settings.FullUri));
     }
     return(await _radarrApi.GetRootFolders(settings.ApiKey, settings.FullUri));
 }
Esempio n. 2
0
        private async Task <string> RadarrRootPath(int overrideId, RadarrSettings settings)
        {
            if (settings.V3)
            {
                var paths = await _radarrV3Api.GetRootFolders(settings.ApiKey, settings.FullUri);

                var selectedPath = paths.FirstOrDefault(x => x.id == overrideId);
                return(selectedPath?.path ?? string.Empty);
            }
            else
            {
                var paths = await _radarrV2Api.GetRootFolders(settings.ApiKey, settings.FullUri);

                var selectedPath = paths.FirstOrDefault(x => x.id == overrideId);
                return(selectedPath?.path ?? string.Empty);
            }
        }