├── tests └── pdbMate.Core.Tests │ ├── settings │ ├── sabnzbd.template.json │ ├── pdbapi.template.json │ └── nzbget.template.json │ ├── SabnzbdServiceTests.cs │ ├── pdbMate.Core.Tests.csproj │ ├── PdbApiServiceTests.cs │ └── NzbGetServiceTests.cs ├── src ├── pdbMate │ ├── SetupLogic │ │ ├── ISetup.cs │ │ ├── AppSettingsResult.cs │ │ └── Setup.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Commands │ │ ├── SetupCommand.cs │ │ ├── RenameCommand.cs │ │ ├── ChangeNamesCommand.cs │ │ ├── DownloadCommand.cs │ │ ├── AutopilotCommand.cs │ │ └── BackfillingCommand.cs │ ├── appsettings.Template.json │ ├── pdbMate.csproj │ └── Program.cs └── pdbMate.Core │ ├── Data │ ├── DownloadClient.cs │ ├── Site.cs │ ├── Nzbget │ │ ├── NzbgetResult.cs │ │ ├── NzbgetResultAddDownload.cs │ │ ├── NzbgetRequestAddDownload.cs │ │ ├── NzbgetQueue.cs │ │ └── NzbgetHistory.cs │ ├── KnownVideoQualityResult.cs │ ├── Actor.cs │ ├── Sabnzbd │ │ ├── SabnzbdSlotAction.cs │ │ ├── SabnzbdAddUrlResult.cs │ │ ├── SabnzbdAddDownloadResult.cs │ │ ├── SabnzbdResult.cs │ │ ├── SabnzbdHistory.cs │ │ ├── SabnzbdQueueSlot.cs │ │ ├── SabnzbdSlot.cs │ │ └── SabnzbdQueue.cs │ ├── VideoQuality.cs │ ├── VideoclipMetaResult.cs │ ├── RenamerResult.cs │ ├── Video.cs │ ├── UsenetIndexer.cs │ ├── SourceFile.cs │ └── UsenetRelease.cs │ ├── Interfaces │ ├── IRenameWorkflow.cs │ ├── IChangeNamingTemplateService.cs │ ├── IVideoQualityProdiver.cs │ ├── IUsenetDownloadService.cs │ ├── IDuplicateFinder.cs │ ├── IVideoMatching.cs │ ├── ISabnzbdService.cs │ ├── INzbgetService.cs │ ├── IFileOperatingService.cs │ ├── IPdbApiService.cs │ └── IRenameService.cs │ ├── SabnzbdServiceOptions.cs │ ├── PdbApiServiceOptions.cs │ ├── NzbgetServiceOptions.cs │ ├── RenameServiceOptions.cs │ ├── UsenetDownloadServiceOptions.cs │ ├── StringNormalizer.cs │ ├── NzbgetServiceCollectionExtensions.cs │ ├── PdbApiServiceCollectionExtensions.cs │ ├── SabnzbdServiceCollectionExtensions.cs │ ├── pdbMate.Core.csproj │ ├── UsenetDownloadServiceCollectionExtensions.cs │ ├── RenameServiceCollectionExtensions.cs │ ├── DuplicateFinder.cs │ ├── RenameWorkflow.cs │ ├── VideoQualityProdiver.cs │ ├── StringExtractor.cs │ ├── SabnzbdService.cs │ ├── ChangeNamingTemplateService.cs │ ├── FileOperatingService.cs │ ├── VideoMatching.cs │ ├── NzbgetService.cs │ ├── PdbApiService.cs │ ├── RenameService.cs │ └── UsenetDownloadService.cs ├── pdbMate.sln ├── README.md ├── .gitignore └── LICENSE /tests/pdbMate.Core.Tests/settings/sabnzbd.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "Url": "http://127.0.0.1:8080/sabnzbd/api", 3 | "ApiKey": "" 4 | } -------------------------------------------------------------------------------- /tests/pdbMate.Core.Tests/settings/pdbapi.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "BaseUrl": "https://api-test.porndb.me/", 3 | "Apikey": "--MY-OWN-APIKEY--" 4 | } -------------------------------------------------------------------------------- /src/pdbMate/SetupLogic/ISetup.cs: -------------------------------------------------------------------------------- 1 | namespace pdbMate.SetupLogic 2 | { 3 | public interface ISetup 4 | { 5 | bool RunSetup(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/pdbMate.Core/Data/DownloadClient.cs: -------------------------------------------------------------------------------- 1 | namespace pdbMate.Core.Data 2 | { 3 | public enum DownloadClient 4 | { 5 | Sabnzbd, 6 | Nzbget 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/pdbMate.Core.Tests/settings/nzbget.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "Hostname": "127.0.0.1", 3 | "Port": 6789, 4 | "Username": "", 5 | "Password": "", 6 | "UseHttps": false 7 | } -------------------------------------------------------------------------------- /src/pdbMate/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "pdbMate": { 4 | "commandName": "Project", 5 | "commandLineArgs": "download" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /src/pdbMate.Core/Interfaces/IRenameWorkflow.cs: -------------------------------------------------------------------------------- 1 | namespace pdbMate.Core.Interfaces 2 | { 3 | public interface IRenameWorkflow 4 | { 5 | bool Rename(bool dryRun); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/pdbMate.Core/Data/Site.cs: -------------------------------------------------------------------------------- 1 | namespace pdbMate.Core.Data 2 | { 3 | public class Site 4 | { 5 | public int Id { get; set; } 6 | public string Sitename { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/pdbMate.Core/Interfaces/IChangeNamingTemplateService.cs: -------------------------------------------------------------------------------- 1 | namespace pdbMate.Core.Interfaces 2 | { 3 | public interface IChangeNamingTemplateService 4 | { 5 | void RenameToNewTemplate(bool dryRun); 6 | } 7 | } -------------------------------------------------------------------------------- /src/pdbMate.Core/SabnzbdServiceOptions.cs: -------------------------------------------------------------------------------- 1 | namespace pdbMate.Core 2 | { 3 | public class SabnzbdServiceOptions 4 | { 5 | public string Url { get; set; } 6 | public string ApiKey { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/pdbMate.Core/Data/Nzbget/NzbgetResult.cs: -------------------------------------------------------------------------------- 1 | namespace pdbMate.Core.Data.Nzbget 2 | { 3 | public class NzbgetResult 4 | { 5 | public string Version { get; set; } 6 | public T Result { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/pdbMate.Core/Data/KnownVideoQualityResult.cs: -------------------------------------------------------------------------------- 1 | namespace pdbMate.Core.Data 2 | { 3 | public class KnownVideoQualityResult 4 | { 5 | public int VideoId { get; set; } 6 | public int VideoQualityId { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /src/pdbMate.Core/Data/Nzbget/NzbgetResultAddDownload.cs: -------------------------------------------------------------------------------- 1 | namespace pdbMate.Core.Data.Nzbget 2 | { 3 | public class NzbgetResultAddDownload 4 | { 5 | public string Version { get; set; } 6 | public int Result { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/pdbMate.Core/Data/Actor.cs: -------------------------------------------------------------------------------- 1 | namespace pdbMate.Core.Data 2 | { 3 | public class Actor 4 | { 5 | public int Id { get; set; } 6 | public string Actorname { get; set; } 7 | public int Gender { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/pdbMate.Core/Data/Sabnzbd/SabnzbdSlotAction.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | namespace pdbMate.Core.Data.Sabnzbd 3 | { 4 | public class SabnzbdSlotAction 5 | { 6 | public string Name { get; set; } 7 | public List Actions { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /src/pdbMate.Core/PdbApiServiceOptions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace pdbMate.Core 4 | { 5 | public class PdbApiServiceOptions 6 | { 7 | public string BaseUrl { get; set; } 8 | public string Apikey { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/pdbMate.Core/Interfaces/IVideoQualityProdiver.cs: -------------------------------------------------------------------------------- 1 | using pdbMate.Core.Data; 2 | 3 | namespace pdbMate.Core.Interfaces 4 | { 5 | public interface IVideoQualityProdiver 6 | { 7 | VideoQuality GetById(int id); 8 | VideoQuality GetByName(string name); 9 | } 10 | } -------------------------------------------------------------------------------- /src/pdbMate.Core/Data/Sabnzbd/SabnzbdAddUrlResult.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace pdbMate.Core.Data.Sabnzbd 4 | { 5 | public class SabnzbdAddUrlResult 6 | { 7 | public bool Status { get; set; } 8 | public List Nzo_ids { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/pdbMate.Core/Interfaces/IUsenetDownloadService.cs: -------------------------------------------------------------------------------- 1 | using pdbMate.Core.Data; 2 | 3 | namespace pdbMate.Core.Interfaces 4 | { 5 | public interface IUsenetDownloadService 6 | { 7 | void Execute(bool dryRun, DownloadClient? client, int? backFillingActors, int? backFillingSites, int daysBack); 8 | } 9 | } -------------------------------------------------------------------------------- /src/pdbMate.Core/Interfaces/IDuplicateFinder.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using pdbMate.Core.Data; 3 | 4 | namespace pdbMate.Core.Interfaces 5 | { 6 | public interface IDuplicateFinder 7 | { 8 | List Process(List renameResults, bool includeQuality); 9 | } 10 | } -------------------------------------------------------------------------------- /src/pdbMate.Core/Data/VideoQuality.cs: -------------------------------------------------------------------------------- 1 | namespace pdbMate.Core.Data 2 | { 3 | public class VideoQuality 4 | { 5 | public int Id { get; set; } 6 | public string Name { get; set; } 7 | public string SimplifiedName { get; set; } 8 | public int BetterQualityOrdinal { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/pdbMate.Core/Data/VideoclipMetaResult.cs: -------------------------------------------------------------------------------- 1 | namespace pdbMate.Core.Data 2 | { 3 | public class VideoclipMetaResult 4 | { 5 | public SourceFile Source { get; set; } 6 | public Video Video { get; set; } 7 | public int VideoQualityId { get; set; } 8 | public string FileExtension { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /src/pdbMate.Core/Data/Sabnzbd/SabnzbdAddDownloadResult.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace pdbMate.Core.Data.Sabnzbd 4 | { 5 | public class SabnzbdAddDownloadResult 6 | { 7 | [JsonPropertyName("status")] 8 | public bool Status { get; set; } 9 | public string Error { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /src/pdbMate.Core/NzbgetServiceOptions.cs: -------------------------------------------------------------------------------- 1 | namespace pdbMate.Core 2 | { 3 | public class NzbgetServiceOptions 4 | { 5 | public string Hostname { get; set; } 6 | public int Port { get; set; } 7 | public string Username { get; set; } 8 | public string Password { get; set; } 9 | public bool UseHttps { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pdbMate.Core/Data/Sabnzbd/SabnzbdResult.cs: -------------------------------------------------------------------------------- 1 | namespace pdbMate.Core.Data.Sabnzbd 2 | { 3 | public class SabnzbdResult 4 | { 5 | public string Status { get; set; } 6 | public string Error { get; set; } 7 | public string Version { get; set; } 8 | public SabnzbdHistory History { get; set; } 9 | public SabnzbdQueue Queue { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pdbMate.Core/Interfaces/IVideoMatching.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using pdbMate.Core.Data; 3 | 4 | namespace pdbMate.Core.Interfaces 5 | { 6 | public interface IVideoMatching 7 | { 8 | Video GetVideoByName(string name); 9 | Video GetVideoByDate(List