Organize remaining model classes into similar namespaces
This commit is contained in:
parent
9766636d04
commit
974b0d4d7a
@ -1,5 +1,5 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using OF_DL.Models;
|
using OF_DL.Models.OfdlApi;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
namespace OF_DL.Helpers;
|
namespace OF_DL.Helpers;
|
||||||
|
|||||||
@ -1,17 +0,0 @@
|
|||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace OF_DL.Models;
|
|
||||||
|
|
||||||
// ReSharper disable once InconsistentNaming
|
|
||||||
public class CDRMProjectRequest
|
|
||||||
{
|
|
||||||
[JsonProperty("pssh")] public string Pssh { get; set; } = "";
|
|
||||||
|
|
||||||
[JsonProperty("licurl")] public string LicenseUrl { get; set; } = "";
|
|
||||||
|
|
||||||
[JsonProperty("headers")] public string Headers { get; set; } = "";
|
|
||||||
|
|
||||||
[JsonProperty("cookies")] public string Cookies { get; set; } = "";
|
|
||||||
|
|
||||||
[JsonProperty("data")] public string Data { get; set; } = "";
|
|
||||||
}
|
|
||||||
@ -3,7 +3,7 @@ using Newtonsoft.Json.Converters;
|
|||||||
using OF_DL.Enumerations;
|
using OF_DL.Enumerations;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
namespace OF_DL.Models;
|
namespace OF_DL.Models.Config;
|
||||||
|
|
||||||
public class Config : IFileNameFormatConfig
|
public class Config : IFileNameFormatConfig
|
||||||
{
|
{
|
||||||
@ -147,4 +147,9 @@ public class Config : IFileNameFormatConfig
|
|||||||
|
|
||||||
return combinedFilenameFormatConfig;
|
return combinedFilenameFormatConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class ShortDateConverter : IsoDateTimeConverter
|
||||||
|
{
|
||||||
|
public ShortDateConverter() => DateTimeFormat = "yyyy-MM-dd";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
namespace OF_DL.Models;
|
namespace OF_DL.Models.Config;
|
||||||
|
|
||||||
public class CreatorConfig : IFileNameFormatConfig
|
public class CreatorConfig : IFileNameFormatConfig
|
||||||
{
|
{
|
||||||
@ -1,4 +1,4 @@
|
|||||||
namespace OF_DL.Models;
|
namespace OF_DL.Models.Config;
|
||||||
|
|
||||||
public class FileNameFormatConfig : IFileNameFormatConfig
|
public class FileNameFormatConfig : IFileNameFormatConfig
|
||||||
{
|
{
|
||||||
@ -1,4 +1,4 @@
|
|||||||
namespace OF_DL.Models;
|
namespace OF_DL.Models.Config;
|
||||||
|
|
||||||
public interface IFileNameFormatConfig
|
public interface IFileNameFormatConfig
|
||||||
{
|
{
|
||||||
@ -1,4 +1,4 @@
|
|||||||
namespace OF_DL.Models;
|
namespace OF_DL.Models.Config;
|
||||||
|
|
||||||
[AttributeUsage(AttributeTargets.Property)]
|
[AttributeUsage(AttributeTargets.Property)]
|
||||||
internal class ToggleableConfigAttribute : Attribute;
|
internal class ToggleableConfigAttribute : Attribute;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
namespace OF_DL.Models;
|
namespace OF_DL.Models.Downloads;
|
||||||
|
|
||||||
public class CreatorDownloadResult
|
public class CreatorDownloadResult
|
||||||
{
|
{
|
||||||
@ -1,4 +1,4 @@
|
|||||||
namespace OF_DL.Models;
|
namespace OF_DL.Models.Downloads;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the result of a download operation.
|
/// Represents the result of a download operation.
|
||||||
@ -1,6 +1,6 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace OF_DL.Models;
|
namespace OF_DL.Models.OfdlApi;
|
||||||
|
|
||||||
public class DynamicRules
|
public class DynamicRules
|
||||||
{
|
{
|
||||||
@ -1,6 +1,6 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace OF_DL.Models;
|
namespace OF_DL.Models.OfdlApi;
|
||||||
|
|
||||||
public class LatestReleaseApiResponse
|
public class LatestReleaseApiResponse
|
||||||
{
|
{
|
||||||
@ -1,9 +1,8 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace OF_DL.Models;
|
namespace OF_DL.Models.OfdlApi;
|
||||||
|
|
||||||
// ReSharper disable once InconsistentNaming
|
public class OfdlRequest
|
||||||
public class OFDLRequest
|
|
||||||
{
|
{
|
||||||
[JsonProperty("pssh")] public string Pssh { get; set; } = "";
|
[JsonProperty("pssh")] public string Pssh { get; set; } = "";
|
||||||
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
using Newtonsoft.Json.Converters;
|
|
||||||
|
|
||||||
namespace OF_DL.Models;
|
|
||||||
|
|
||||||
public class ShortDateConverter : IsoDateTimeConverter
|
|
||||||
{
|
|
||||||
public ShortDateConverter() => DateTimeFormat = "yyyy-MM-dd";
|
|
||||||
}
|
|
||||||
@ -28,6 +28,7 @@ using StreamEntities = OF_DL.Models.Entities.Streams;
|
|||||||
using SubscriptionEntities = OF_DL.Models.Entities.Subscriptions;
|
using SubscriptionEntities = OF_DL.Models.Entities.Subscriptions;
|
||||||
using UserEntities = OF_DL.Models.Entities.Users;
|
using UserEntities = OF_DL.Models.Entities.Users;
|
||||||
using OF_DL.Models.Mappers;
|
using OF_DL.Models.Mappers;
|
||||||
|
using OF_DL.Models.OfdlApi;
|
||||||
using OF_DL.Widevine;
|
using OF_DL.Widevine;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using static OF_DL.Utils.HttpUtil;
|
using static OF_DL.Utils.HttpUtil;
|
||||||
@ -3147,7 +3148,7 @@ public class ApiService(IAuthService authService, IConfigService configService,
|
|||||||
HttpClient client = new();
|
HttpClient client = new();
|
||||||
int attempt = 0;
|
int attempt = 0;
|
||||||
|
|
||||||
OFDLRequest ofdlRequest = new()
|
OfdlRequest ofdlRequest = new()
|
||||||
{
|
{
|
||||||
Pssh = pssh, LicenseUrl = licenceUrl, Headers = JsonConvert.SerializeObject(drmHeaders)
|
Pssh = pssh, LicenseUrl = licenceUrl, Headers = JsonConvert.SerializeObject(drmHeaders)
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,13 +1,12 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Akka.Configuration;
|
using Akka.Configuration;
|
||||||
using Akka.Configuration.Hocon;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using OF_DL.Models;
|
|
||||||
using OF_DL.Enumerations;
|
using OF_DL.Enumerations;
|
||||||
|
using OF_DL.Models.Config;
|
||||||
using OF_DL.Utils;
|
using OF_DL.Utils;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using Config = OF_DL.Models.Config;
|
using Config = OF_DL.Models.Config.Config;
|
||||||
|
|
||||||
namespace OF_DL.Services;
|
namespace OF_DL.Services;
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using OF_DL.Enumerations;
|
using OF_DL.Enumerations;
|
||||||
using OF_DL.Models;
|
using OF_DL.Models.Config;
|
||||||
|
using OF_DL.Models.Downloads;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using PostEntities = OF_DL.Models.Entities.Posts;
|
using PostEntities = OF_DL.Models.Entities.Posts;
|
||||||
using PurchasedEntities = OF_DL.Models.Entities.Purchased;
|
using PurchasedEntities = OF_DL.Models.Entities.Purchased;
|
||||||
|
|||||||
@ -5,6 +5,7 @@ using FFmpeg.NET;
|
|||||||
using FFmpeg.NET.Events;
|
using FFmpeg.NET.Events;
|
||||||
using OF_DL.Models;
|
using OF_DL.Models;
|
||||||
using OF_DL.Enumerations;
|
using OF_DL.Enumerations;
|
||||||
|
using OF_DL.Models.Downloads;
|
||||||
using ArchivedEntities = OF_DL.Models.Entities.Archived;
|
using ArchivedEntities = OF_DL.Models.Entities.Archived;
|
||||||
using MessageEntities = OF_DL.Models.Entities.Messages;
|
using MessageEntities = OF_DL.Models.Entities.Messages;
|
||||||
using PostEntities = OF_DL.Models.Entities.Posts;
|
using PostEntities = OF_DL.Models.Entities.Posts;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using OF_DL.Models;
|
using OF_DL.Models.Config;
|
||||||
|
|
||||||
namespace OF_DL.Services;
|
namespace OF_DL.Services;
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using OF_DL.Models;
|
using OF_DL.Models.Downloads;
|
||||||
|
|
||||||
namespace OF_DL.Services;
|
namespace OF_DL.Services;
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
using OF_DL.Models;
|
using OF_DL.Models.Downloads;
|
||||||
using UserEntities = OF_DL.Models.Entities.Users;
|
|
||||||
|
|
||||||
namespace OF_DL.Services;
|
namespace OF_DL.Services;
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using OF_DL.Models;
|
using OF_DL.Models.Downloads;
|
||||||
using ArchivedEntities = OF_DL.Models.Entities.Archived;
|
using ArchivedEntities = OF_DL.Models.Entities.Archived;
|
||||||
using MessageEntities = OF_DL.Models.Entities.Messages;
|
using MessageEntities = OF_DL.Models.Entities.Messages;
|
||||||
using PostEntities = OF_DL.Models.Entities.Posts;
|
using PostEntities = OF_DL.Models.Entities.Posts;
|
||||||
|
|||||||
@ -4,6 +4,7 @@ using System.Runtime.InteropServices;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using OF_DL.Helpers;
|
using OF_DL.Helpers;
|
||||||
using OF_DL.Models;
|
using OF_DL.Models;
|
||||||
|
using OF_DL.Models.OfdlApi;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using WidevineConstants = OF_DL.Widevine.Constants;
|
using WidevineConstants = OF_DL.Widevine.Constants;
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using OF_DL.Models;
|
using OF_DL.Models.Downloads;
|
||||||
using OF_DL.Services;
|
using OF_DL.Services;
|
||||||
using Spectre.Console;
|
using Spectre.Console;
|
||||||
|
|
||||||
@ -43,26 +43,18 @@ public class SpectreDownloadEventHandler : IDownloadEventHandler
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnContentFound(string contentType, int mediaCount, int objectCount)
|
public void OnContentFound(string contentType, int mediaCount, int objectCount) =>
|
||||||
{
|
|
||||||
AnsiConsole.Markup($"[red]Found {mediaCount} Media from {objectCount} {Markup.Escape(contentType)}\n[/]");
|
AnsiConsole.Markup($"[red]Found {mediaCount} Media from {objectCount} {Markup.Escape(contentType)}\n[/]");
|
||||||
}
|
|
||||||
|
|
||||||
public void OnNoContentFound(string contentType)
|
public void OnNoContentFound(string contentType) =>
|
||||||
{
|
|
||||||
AnsiConsole.Markup($"[red]Found 0 {Markup.Escape(contentType)}\n[/]");
|
AnsiConsole.Markup($"[red]Found 0 {Markup.Escape(contentType)}\n[/]");
|
||||||
}
|
|
||||||
|
|
||||||
public void OnDownloadComplete(string contentType, DownloadResult result)
|
public void OnDownloadComplete(string contentType, DownloadResult result) =>
|
||||||
{
|
|
||||||
AnsiConsole.Markup(
|
AnsiConsole.Markup(
|
||||||
$"[red]{Markup.Escape(contentType)} Already Downloaded: {result.ExistingDownloads} New {Markup.Escape(contentType)} Downloaded: {result.NewDownloads}[/]\n");
|
$"[red]{Markup.Escape(contentType)} Already Downloaded: {result.ExistingDownloads} New {Markup.Escape(contentType)} Downloaded: {result.NewDownloads}[/]\n");
|
||||||
}
|
|
||||||
|
|
||||||
public void OnUserStarting(string username)
|
public void OnUserStarting(string username) =>
|
||||||
{
|
|
||||||
AnsiConsole.Markup($"[red]\nScraping Data for {Markup.Escape(username)}\n[/]");
|
AnsiConsole.Markup($"[red]\nScraping Data for {Markup.Escape(username)}\n[/]");
|
||||||
}
|
|
||||||
|
|
||||||
public void OnUserComplete(string username, CreatorDownloadResult result)
|
public void OnUserComplete(string username, CreatorDownloadResult result)
|
||||||
{
|
{
|
||||||
@ -90,15 +82,10 @@ public class SpectreDownloadEventHandler : IDownloadEventHandler
|
|||||||
AnsiConsole.Markup("\n");
|
AnsiConsole.Markup("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnScrapeComplete(TimeSpan elapsed)
|
public void OnScrapeComplete(TimeSpan elapsed) =>
|
||||||
{
|
|
||||||
AnsiConsole.Markup($"[green]Scrape Completed in {elapsed.TotalMinutes:0.00} minutes\n[/]");
|
AnsiConsole.Markup($"[green]Scrape Completed in {elapsed.TotalMinutes:0.00} minutes\n[/]");
|
||||||
}
|
|
||||||
|
|
||||||
public void OnMessage(string message)
|
public void OnMessage(string message) => AnsiConsole.Markup($"[red]{Markup.Escape(message)}\n[/]");
|
||||||
{
|
|
||||||
AnsiConsole.Markup($"[red]{Markup.Escape(message)}\n[/]");
|
|
||||||
}
|
|
||||||
|
|
||||||
private static ProgressColumn[] GetProgressColumns(bool showScrapeSize)
|
private static ProgressColumn[] GetProgressColumns(bool showScrapeSize)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,6 +3,8 @@ using Microsoft.Extensions.DependencyInjection;
|
|||||||
using OF_DL.CLI;
|
using OF_DL.CLI;
|
||||||
using OF_DL.Models;
|
using OF_DL.Models;
|
||||||
using OF_DL.Enumerations;
|
using OF_DL.Enumerations;
|
||||||
|
using OF_DL.Models.Config;
|
||||||
|
using OF_DL.Models.Downloads;
|
||||||
using OF_DL.Models.Entities.Users;
|
using OF_DL.Models.Entities.Users;
|
||||||
using OF_DL.Services;
|
using OF_DL.Services;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user