mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-17 21:25:39 -04:00
New: Lidarr to Readarr
This commit is contained in:
@@ -39,7 +39,7 @@ namespace NzbDrone.Core.Backup
|
||||
|
||||
private string _backupTempFolder;
|
||||
|
||||
public static readonly Regex BackupFileRegex = new Regex(@"lidarr_backup_(v[0-9.]+_)?[._0-9]+\.zip", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
public static readonly Regex BackupFileRegex = new Regex(@"readarr_backup_(v[0-9.]+_)?[._0-9]+\.zip", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
public BackupService(IMainDatabase maindDb,
|
||||
IMakeDatabaseBackup makeDatabaseBackup,
|
||||
@@ -59,7 +59,7 @@ namespace NzbDrone.Core.Backup
|
||||
_configService = configService;
|
||||
_logger = logger;
|
||||
|
||||
_backupTempFolder = Path.Combine(_appFolderInfo.TempFolder, "lidarr_backup");
|
||||
_backupTempFolder = Path.Combine(_appFolderInfo.TempFolder, "readarr_backup");
|
||||
}
|
||||
|
||||
public void Backup(BackupType backupType)
|
||||
@@ -69,7 +69,7 @@ namespace NzbDrone.Core.Backup
|
||||
_diskProvider.EnsureFolder(_backupTempFolder);
|
||||
_diskProvider.EnsureFolder(GetBackupFolder(backupType));
|
||||
|
||||
var backupFilename = string.Format("lidarr_backup_v{0}_{1:yyyy.MM.dd_HH.mm.ss}.zip", BuildInfo.Version, DateTime.Now);
|
||||
var backupFilename = string.Format("readarr_backup_v{0}_{1:yyyy.MM.dd_HH.mm.ss}.zip", BuildInfo.Version, DateTime.Now);
|
||||
var backupPath = Path.Combine(GetBackupFolder(backupType), backupFilename);
|
||||
|
||||
Cleanup();
|
||||
@@ -86,7 +86,7 @@ namespace NzbDrone.Core.Backup
|
||||
_logger.ProgressDebug("Creating backup zip");
|
||||
|
||||
// Delete journal file created during database backup
|
||||
_diskProvider.DeleteFile(Path.Combine(_backupTempFolder, "lidarr.db-journal"));
|
||||
_diskProvider.DeleteFile(Path.Combine(_backupTempFolder, "readarr.db-journal"));
|
||||
|
||||
_archiveService.CreateZip(backupPath, _diskProvider.GetFiles(_backupTempFolder, SearchOption.TopDirectoryOnly));
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace NzbDrone.Core.Backup
|
||||
if (backupFileName.EndsWith(".zip"))
|
||||
{
|
||||
var restoredFile = false;
|
||||
var temporaryPath = Path.Combine(_appFolderInfo.TempFolder, "lidarr_backup_restore");
|
||||
var temporaryPath = Path.Combine(_appFolderInfo.TempFolder, "readarr_backup_restore");
|
||||
|
||||
_archiveService.Extract(backupFileName, temporaryPath);
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace NzbDrone.Core.Backup
|
||||
restoredFile = true;
|
||||
}
|
||||
|
||||
if (fileName.Equals("lidarr.db", StringComparison.InvariantCultureIgnoreCase))
|
||||
if (fileName.Equals("readarr.db", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
_diskProvider.MoveFile(file, _appFolderInfo.GetDatabaseRestore(), true);
|
||||
restoredFile = true;
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace NzbDrone.Core.Configuration
|
||||
}
|
||||
}
|
||||
|
||||
public int Port => GetValueInt("Port", 8686);
|
||||
public int Port => GetValueInt("Port", 8787);
|
||||
|
||||
public int SslPort => GetValueInt("SslPort", 6868);
|
||||
|
||||
@@ -320,12 +320,12 @@ namespace NzbDrone.Core.Configuration
|
||||
|
||||
if (contents.IsNullOrWhiteSpace())
|
||||
{
|
||||
throw new InvalidConfigFileException($"{_configFile} is empty. Please delete the config file and Lidarr will recreate it.");
|
||||
throw new InvalidConfigFileException($"{_configFile} is empty. Please delete the config file and Readarr will recreate it.");
|
||||
}
|
||||
|
||||
if (contents.All(char.IsControl))
|
||||
{
|
||||
throw new InvalidConfigFileException($"{_configFile} is corrupt. Please delete the config file and Lidarr will recreate it.");
|
||||
throw new InvalidConfigFileException($"{_configFile} is corrupt. Please delete the config file and Readarr will recreate it.");
|
||||
}
|
||||
|
||||
return XDocument.Parse(_diskProvider.ReadAllText(_configFile));
|
||||
@@ -339,11 +339,11 @@ namespace NzbDrone.Core.Configuration
|
||||
}
|
||||
catch (XmlException ex)
|
||||
{
|
||||
throw new InvalidConfigFileException($"{_configFile} is corrupt is invalid. Please delete the config file and Lidarr will recreate it.", ex);
|
||||
throw new InvalidConfigFileException($"{_configFile} is corrupt is invalid. Please delete the config file and Readarr will recreate it.", ex);
|
||||
}
|
||||
catch (UnauthorizedAccessException ex)
|
||||
{
|
||||
throw new AccessDeniedConfigFileException($"Lidarr does not have access to config file: {_configFile}. Please fix permissions", ex);
|
||||
throw new AccessDeniedConfigFileException($"Readarr does not have access to config file: {_configFile}. Please fix permissions", ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -358,7 +358,7 @@ namespace NzbDrone.Core.Configuration
|
||||
}
|
||||
catch (UnauthorizedAccessException ex)
|
||||
{
|
||||
throw new AccessDeniedConfigFileException($"Lidarr does not have access to config file: {_configFile}. Please fix permissions", ex);
|
||||
throw new AccessDeniedConfigFileException($"Readarr does not have access to config file: {_configFile}. Please fix permissions", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ using NzbDrone.Common.Exceptions;
|
||||
|
||||
namespace NzbDrone.Core.Datastore
|
||||
{
|
||||
public class CorruptDatabaseException : LidarrStartupException
|
||||
public class CorruptDatabaseException : ReadarrStartupException
|
||||
{
|
||||
public CorruptDatabaseException(string message, params object[] args)
|
||||
: base(message, args)
|
||||
|
||||
@@ -122,11 +122,11 @@ namespace NzbDrone.Core.Datastore
|
||||
throw new CorruptDatabaseException("Database file: {0} is corrupt, restore from backup if available. See: https://github.com/Sonarr/Sonarr/wiki/FAQ#i-use-sonarr-on-a-mac-and-it-suddenly-stopped-working-what-happened", e, fileName);
|
||||
}
|
||||
|
||||
throw new CorruptDatabaseException("Database file: {0} is corrupt, restore from backup if available. See: https://github.com/Lidarr/Lidarr/wiki/FAQ#i-am-getting-an-error-database-disk-image-is-malformed", e, fileName);
|
||||
throw new CorruptDatabaseException("Database file: {0} is corrupt, restore from backup if available. See: https://github.com/Readarr/Readarr/wiki/FAQ#i-am-getting-an-error-database-disk-image-is-malformed", e, fileName);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new LidarrStartupException(e, "Error creating main database");
|
||||
throw new ReadarrStartupException(e, "Error creating main database");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ namespace NzbDrone.Core.Datastore
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new LidarrStartupException(e, "Error creating log database");
|
||||
throw new ReadarrStartupException(e, "Error creating log database");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
@@ -9,93 +10,104 @@ namespace NzbDrone.Core.Datastore.Migration
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Create.TableForModel("Config")
|
||||
.WithColumn("Key").AsString().Unique()
|
||||
.WithColumn("Value").AsString();
|
||||
.WithColumn("Key").AsString().Unique()
|
||||
.WithColumn("Value").AsString();
|
||||
|
||||
Create.TableForModel("RootFolders")
|
||||
.WithColumn("Path").AsString().Unique();
|
||||
.WithColumn("Path").AsString().Unique()
|
||||
.WithColumn("Name").AsString().Nullable()
|
||||
.WithColumn("DefaultMetadataProfileId").AsInt32().WithDefaultValue(0)
|
||||
.WithColumn("DefaultQualityProfileId").AsInt32().WithDefaultValue(0)
|
||||
.WithColumn("DefaultMonitorOption").AsInt32().WithDefaultValue(0)
|
||||
.WithColumn("DefaultTags").AsString().Nullable();
|
||||
|
||||
Create.TableForModel("Artists")
|
||||
.WithColumn("ForeignArtistId").AsString().Unique()
|
||||
.WithColumn("MBId").AsString().Nullable()
|
||||
.WithColumn("AMId").AsString().Nullable()
|
||||
.WithColumn("TADBId").AsInt32().Nullable()
|
||||
.WithColumn("DiscogsId").AsInt32().Nullable()
|
||||
.WithColumn("Name").AsString()
|
||||
.WithColumn("NameSlug").AsString().Nullable().Unique()
|
||||
.WithColumn("CleanName").AsString().Indexed()
|
||||
.WithColumn("Status").AsInt32()
|
||||
.WithColumn("Overview").AsString().Nullable()
|
||||
.WithColumn("Images").AsString()
|
||||
.WithColumn("Path").AsString().Indexed()
|
||||
.WithColumn("Monitored").AsBoolean()
|
||||
.WithColumn("AlbumFolder").AsBoolean()
|
||||
.WithColumn("LastInfoSync").AsDateTime().Nullable()
|
||||
.WithColumn("LastDiskSync").AsDateTime().Nullable()
|
||||
.WithColumn("DateFormed").AsDateTime().Nullable()
|
||||
.WithColumn("Members").AsString().Nullable()
|
||||
.WithColumn("Ratings").AsString().Nullable()
|
||||
.WithColumn("Genres").AsString().Nullable()
|
||||
.WithColumn("SortName").AsString().Nullable()
|
||||
.WithColumn("ProfileId").AsInt32().Nullable()
|
||||
.WithColumn("QualityProfileId").AsInt32().Nullable()
|
||||
.WithColumn("Tags").AsString().Nullable()
|
||||
.WithColumn("Added").AsDateTime().Nullable()
|
||||
.WithColumn("AddOptions").AsString().Nullable()
|
||||
.WithColumn("LanguageProfileId").AsInt32().WithDefaultValue(1)
|
||||
.WithColumn("Links").AsString().Nullable()
|
||||
.WithColumn("ArtistType").AsString().Nullable()
|
||||
.WithColumn("MetadataProfileId").AsInt32().WithDefaultValue(1)
|
||||
.WithColumn("ArtistMetadataId").AsInt32().Unique();
|
||||
|
||||
Create.TableForModel("ArtistMetadata")
|
||||
.WithColumn("ForeignArtistId").AsString().Unique()
|
||||
.WithColumn("Name").AsString()
|
||||
.WithColumn("Overview").AsString().Nullable()
|
||||
.WithColumn("Disambiguation").AsString().Nullable()
|
||||
.WithColumn("PrimaryAlbumTypes").AsString().Nullable()
|
||||
.WithColumn("SecondaryAlbumTypes").AsString().Nullable();
|
||||
.WithColumn("Type").AsString().Nullable()
|
||||
.WithColumn("Status").AsInt32()
|
||||
.WithColumn("Images").AsString()
|
||||
.WithColumn("Links").AsString().Nullable()
|
||||
.WithColumn("Genres").AsString().Nullable()
|
||||
.WithColumn("Ratings").AsString().Nullable()
|
||||
.WithColumn("Members").AsString().Nullable()
|
||||
.WithColumn("Aliases").AsString().WithDefaultValue("[]")
|
||||
.WithColumn("OldForeignArtistIds").AsString().WithDefaultValue("[]");
|
||||
|
||||
Create.TableForModel("Albums")
|
||||
.WithColumn("ForeignAlbumId").AsString().Unique()
|
||||
.WithColumn("ArtistId").AsInt32()
|
||||
.WithColumn("MBId").AsString().Nullable().Indexed()
|
||||
.WithColumn("AMId").AsString().Nullable()
|
||||
.WithColumn("TADBId").AsInt32().Nullable().Indexed()
|
||||
.WithColumn("DiscogsId").AsInt32().Nullable()
|
||||
.WithColumn("Title").AsString()
|
||||
.WithColumn("TitleSlug").AsString().Nullable().Unique()
|
||||
.WithColumn("CleanTitle").AsString().Indexed()
|
||||
.WithColumn("Overview").AsString().Nullable()
|
||||
.WithColumn("Images").AsString()
|
||||
.WithColumn("Path").AsString().Indexed()
|
||||
.WithColumn("Monitored").AsBoolean()
|
||||
.WithColumn("LastInfoSync").AsDateTime().Nullable()
|
||||
.WithColumn("LastDiskSync").AsDateTime().Nullable()
|
||||
.WithColumn("ReleaseDate").AsDateTime().Nullable()
|
||||
.WithColumn("Ratings").AsString().Nullable()
|
||||
.WithColumn("Genres").AsString().Nullable()
|
||||
.WithColumn("Label").AsString().Nullable()
|
||||
.WithColumn("SortTitle").AsString().Nullable()
|
||||
.WithColumn("ProfileId").AsInt32().Nullable()
|
||||
.WithColumn("Tags").AsString().Nullable()
|
||||
.WithColumn("Added").AsDateTime().Nullable()
|
||||
.WithColumn("AlbumType").AsString()
|
||||
.WithColumn("AddOptions").AsString().Nullable()
|
||||
.WithColumn("Duration").AsInt32().WithDefaultValue(0);
|
||||
.WithColumn("SecondaryTypes").AsString().Nullable()
|
||||
.WithColumn("Disambiguation").AsString().Nullable()
|
||||
.WithColumn("ArtistMetadataId").AsInt32().WithDefaultValue(0)
|
||||
.WithColumn("AnyReleaseOk").AsBoolean().WithDefaultValue(true)
|
||||
.WithColumn("Links").AsString().Nullable()
|
||||
.WithColumn("OldForeignAlbumIds").AsString().WithDefaultValue("[]");
|
||||
|
||||
Create.TableForModel("AlbumReleases")
|
||||
.WithColumn("ForeignReleaseId").AsString().Unique()
|
||||
.WithColumn("AlbumId").AsInt32().Indexed()
|
||||
.WithColumn("Title").AsString()
|
||||
.WithColumn("Status").AsString()
|
||||
.WithColumn("Duration").AsInt32().WithDefaultValue(0)
|
||||
.WithColumn("Label").AsString().Nullable()
|
||||
.WithColumn("Disambiguation").AsString().Nullable()
|
||||
.WithColumn("Country").AsString().Nullable()
|
||||
.WithColumn("ReleaseDate").AsDateTime().Nullable()
|
||||
.WithColumn("Media").AsString().Nullable()
|
||||
.WithColumn("TrackCount").AsInt32().Nullable()
|
||||
.WithColumn("Monitored").AsBoolean()
|
||||
.WithColumn("OldForeignReleaseIds").AsString().WithDefaultValue("[]");
|
||||
|
||||
Create.TableForModel("Tracks")
|
||||
.WithColumn("ForeignTrackId").AsString().Unique()
|
||||
.WithColumn("ArtistId").AsInt32().Indexed()
|
||||
.WithColumn("AlbumId").AsInt32()
|
||||
.WithColumn("TrackNumber").AsInt32()
|
||||
.WithColumn("Title").AsString().Nullable()
|
||||
.WithColumn("Explicit").AsBoolean()
|
||||
.WithColumn("Compilation").AsBoolean()
|
||||
.WithColumn("DiscNumber").AsInt32().Nullable()
|
||||
.WithColumn("TrackFileId").AsInt32().Nullable().Indexed()
|
||||
.WithColumn("Monitored").AsBoolean()
|
||||
.WithColumn("Ratings").AsString().Nullable()
|
||||
.WithColumn("Duration").AsInt32().WithDefaultValue(0);
|
||||
.WithColumn("Duration").AsInt32().WithDefaultValue(0)
|
||||
.WithColumn("MediumNumber").AsInt32().WithDefaultValue(0)
|
||||
.WithColumn("AbsoluteTrackNumber").AsInt32().WithDefaultValue(0)
|
||||
.WithColumn("TrackNumber").AsString().Nullable()
|
||||
.WithColumn("ForeignRecordingId").AsString().WithDefaultValue("0")
|
||||
.WithColumn("AlbumReleaseId").AsInt32().WithDefaultValue(0)
|
||||
.WithColumn("ArtistMetadataId").AsInt32().WithDefaultValue(0)
|
||||
.WithColumn("OldForeignRecordingIds").AsString().WithDefaultValue("[]")
|
||||
.WithColumn("OldForeignTrackIds").AsString().WithDefaultValue("[]");
|
||||
|
||||
Create.Index().OnTable("Tracks").OnColumn("ArtistId").Ascending()
|
||||
.OnColumn("AlbumId").Ascending()
|
||||
.OnColumn("TrackNumber").Ascending();
|
||||
|
||||
Create.TableForModel("TrackFiles")
|
||||
.WithColumn("ArtistId").AsInt32().Indexed()
|
||||
.WithColumn("AlbumId").AsInt32().Indexed()
|
||||
.WithColumn("Quality").AsString()
|
||||
.WithColumn("Size").AsInt64()
|
||||
@@ -103,8 +115,8 @@ namespace NzbDrone.Core.Datastore.Migration
|
||||
.WithColumn("DateAdded").AsDateTime()
|
||||
.WithColumn("ReleaseGroup").AsString().Nullable()
|
||||
.WithColumn("MediaInfo").AsString().Nullable()
|
||||
.WithColumn("RelativePath").AsString().Nullable()
|
||||
.WithColumn("Language").AsInt32().WithDefaultValue(0);
|
||||
.WithColumn("Modified").AsDateTime().WithDefaultValue(new DateTime(2000, 1, 1))
|
||||
.WithColumn("Path").AsString().NotNullable().Unique();
|
||||
|
||||
Create.TableForModel("History")
|
||||
.WithColumn("SourceTitle").AsString()
|
||||
@@ -113,7 +125,6 @@ namespace NzbDrone.Core.Datastore.Migration
|
||||
.WithColumn("Data").AsString()
|
||||
.WithColumn("EventType").AsInt32().Nullable().Indexed()
|
||||
.WithColumn("DownloadId").AsString().Nullable().Indexed()
|
||||
.WithColumn("Language").AsInt32().NotNullable().WithDefaultValue(0)
|
||||
.WithColumn("ArtistId").AsInt32().WithDefaultValue(0)
|
||||
.WithColumn("AlbumId").AsInt32().Indexed().WithDefaultValue(0)
|
||||
.WithColumn("TrackId").AsInt32().WithDefaultValue(0);
|
||||
@@ -121,18 +132,24 @@ namespace NzbDrone.Core.Datastore.Migration
|
||||
Create.TableForModel("Notifications")
|
||||
.WithColumn("Name").AsString()
|
||||
.WithColumn("OnGrab").AsBoolean()
|
||||
.WithColumn("OnDownload").AsBoolean()
|
||||
.WithColumn("Settings").AsString()
|
||||
.WithColumn("Implementation").AsString()
|
||||
.WithColumn("ConfigContract").AsString().Nullable()
|
||||
.WithColumn("OnUpgrade").AsBoolean().Nullable()
|
||||
.WithColumn("Tags").AsString().Nullable()
|
||||
.WithColumn("OnRename").AsBoolean().NotNullable();
|
||||
.WithColumn("OnRename").AsBoolean().NotNullable()
|
||||
.WithColumn("OnReleaseImport").AsBoolean().WithDefaultValue(0)
|
||||
.WithColumn("OnHealthIssue").AsBoolean().WithDefaultValue(0)
|
||||
.WithColumn("IncludeHealthWarnings").AsBoolean().WithDefaultValue(0)
|
||||
.WithColumn("OnDownloadFailure").AsBoolean().WithDefaultValue(0)
|
||||
.WithColumn("OnImportFailure").AsBoolean().WithDefaultValue(0)
|
||||
.WithColumn("OnTrackRetag").AsBoolean().WithDefaultValue(0);
|
||||
|
||||
Create.TableForModel("ScheduledTasks")
|
||||
.WithColumn("TypeName").AsString().Unique()
|
||||
.WithColumn("Interval").AsInt32()
|
||||
.WithColumn("LastExecution").AsDateTime();
|
||||
.WithColumn("LastExecution").AsDateTime()
|
||||
.WithColumn("LastStartTime").AsDateTime().Nullable();
|
||||
|
||||
Create.TableForModel("Indexers")
|
||||
.WithColumn("Name").AsString().Unique()
|
||||
@@ -140,12 +157,20 @@ namespace NzbDrone.Core.Datastore.Migration
|
||||
.WithColumn("Settings").AsString().Nullable()
|
||||
.WithColumn("ConfigContract").AsString().Nullable()
|
||||
.WithColumn("EnableRss").AsBoolean().Nullable()
|
||||
.WithColumn("EnableSearch").AsBoolean().Nullable();
|
||||
.WithColumn("EnableAutomaticSearch").AsBoolean().Nullable()
|
||||
.WithColumn("EnableInteractiveSearch").AsBoolean().NotNullable();
|
||||
|
||||
Create.TableForModel("Profiles")
|
||||
Create.TableForModel("QualityProfiles")
|
||||
.WithColumn("Name").AsString().Unique()
|
||||
.WithColumn("Cutoff").AsInt32()
|
||||
.WithColumn("Items").AsString().NotNullable();
|
||||
.WithColumn("Items").AsString().NotNullable()
|
||||
.WithColumn("UpgradeAllowed").AsInt32().Nullable();
|
||||
|
||||
Create.TableForModel("MetadataProfiles")
|
||||
.WithColumn("Name").AsString().Unique()
|
||||
.WithColumn("PrimaryAlbumTypes").AsString()
|
||||
.WithColumn("SecondaryAlbumTypes").AsString()
|
||||
.WithColumn("ReleaseStatuses").AsString().WithDefaultValue("");
|
||||
|
||||
Create.TableForModel("QualityDefinitions")
|
||||
.WithColumn("Quality").AsInt32().Unique()
|
||||
@@ -158,7 +183,8 @@ namespace NzbDrone.Core.Datastore.Migration
|
||||
.WithColumn("ArtistFolderFormat").AsString().Nullable()
|
||||
.WithColumn("RenameTracks").AsBoolean().Nullable()
|
||||
.WithColumn("StandardTrackFormat").AsString().Nullable()
|
||||
.WithColumn("AlbumFolderFormat").AsString().Nullable();
|
||||
.WithColumn("AlbumFolderFormat").AsString().Nullable()
|
||||
.WithColumn("MultiDiscTrackFormat").AsString().Nullable();
|
||||
|
||||
Create.TableForModel("Blacklist")
|
||||
.WithColumn("SourceTitle").AsString()
|
||||
@@ -170,7 +196,6 @@ namespace NzbDrone.Core.Datastore.Migration
|
||||
.WithColumn("Indexer").AsString().Nullable()
|
||||
.WithColumn("Message").AsString().Nullable()
|
||||
.WithColumn("TorrentInfoHash").AsString().Nullable()
|
||||
.WithColumn("Language").AsInt32().NotNullable().WithDefaultValue(0)
|
||||
.WithColumn("ArtistId").AsInt32().WithDefaultValue(0)
|
||||
.WithColumn("AlbumIds").AsString().WithDefaultValue("");
|
||||
|
||||
@@ -198,14 +223,16 @@ namespace NzbDrone.Core.Datastore.Migration
|
||||
.WithColumn("Name").AsString().NotNullable()
|
||||
.WithColumn("Implementation").AsString().NotNullable()
|
||||
.WithColumn("Settings").AsString().NotNullable()
|
||||
.WithColumn("ConfigContract").AsString().NotNullable();
|
||||
.WithColumn("ConfigContract").AsString().NotNullable()
|
||||
.WithColumn("Priority").AsInt32().WithDefaultValue(1);
|
||||
|
||||
Create.TableForModel("PendingReleases")
|
||||
.WithColumn("Title").AsString()
|
||||
.WithColumn("Added").AsDateTime()
|
||||
.WithColumn("Release").AsString()
|
||||
.WithColumn("ArtistId").AsInt32().WithDefaultValue(0)
|
||||
.WithColumn("ParsedAlbumInfo").AsString().WithDefaultValue("");
|
||||
.WithColumn("ParsedAlbumInfo").AsString().WithDefaultValue("")
|
||||
.WithColumn("Reason").AsInt32().WithDefaultValue(0);
|
||||
|
||||
Create.TableForModel("RemotePathMappings")
|
||||
.WithColumn("Host").AsString()
|
||||
@@ -215,11 +242,12 @@ namespace NzbDrone.Core.Datastore.Migration
|
||||
Create.TableForModel("Tags")
|
||||
.WithColumn("Label").AsString().Unique();
|
||||
|
||||
Create.TableForModel("Restrictions")
|
||||
Create.TableForModel("ReleaseProfiles")
|
||||
.WithColumn("Required").AsString().Nullable()
|
||||
.WithColumn("Preferred").AsString().Nullable()
|
||||
.WithColumn("Ignored").AsString().Nullable()
|
||||
.WithColumn("Tags").AsString().NotNullable();
|
||||
.WithColumn("Tags").AsString().NotNullable()
|
||||
.WithColumn("IncludePreferredWhenRenaming").AsBoolean().WithDefaultValue(true);
|
||||
|
||||
Create.TableForModel("DelayProfiles")
|
||||
.WithColumn("EnableUsenet").AsBoolean().NotNullable()
|
||||
@@ -271,20 +299,61 @@ namespace NzbDrone.Core.Datastore.Migration
|
||||
.WithColumn("RelativePath").AsString().NotNullable()
|
||||
.WithColumn("Extension").AsString().NotNullable()
|
||||
.WithColumn("Added").AsDateTime().NotNullable()
|
||||
.WithColumn("LastUpdated").AsDateTime().NotNullable()
|
||||
.WithColumn("Language").AsInt32().NotNullable();
|
||||
|
||||
Create.TableForModel("LanguageProfiles")
|
||||
.WithColumn("Name").AsString().Unique()
|
||||
.WithColumn("Languages").AsString()
|
||||
.WithColumn("Cutoff").AsInt32();
|
||||
.WithColumn("LastUpdated").AsDateTime().NotNullable();
|
||||
|
||||
Create.TableForModel("DownloadClientStatus")
|
||||
.WithColumn("ProviderId").AsInt32().NotNullable().Unique()
|
||||
.WithColumn("InitialFailure").AsDateTime().Nullable()
|
||||
.WithColumn("MostRecentFailure").AsDateTime().Nullable()
|
||||
.WithColumn("EscalationLevel").AsInt32().NotNullable()
|
||||
.WithColumn("DisabledTill").AsDateTime().Nullable();
|
||||
.WithColumn("ProviderId").AsInt32().NotNullable().Unique()
|
||||
.WithColumn("InitialFailure").AsDateTime().Nullable()
|
||||
.WithColumn("MostRecentFailure").AsDateTime().Nullable()
|
||||
.WithColumn("EscalationLevel").AsInt32().NotNullable()
|
||||
.WithColumn("DisabledTill").AsDateTime().Nullable();
|
||||
|
||||
Create.TableForModel("ImportLists")
|
||||
.WithColumn("Name").AsString().Unique()
|
||||
.WithColumn("Implementation").AsString()
|
||||
.WithColumn("Settings").AsString().Nullable()
|
||||
.WithColumn("ConfigContract").AsString().Nullable()
|
||||
.WithColumn("EnableAutomaticAdd").AsBoolean().Nullable()
|
||||
.WithColumn("RootFolderPath").AsString()
|
||||
.WithColumn("ShouldMonitor").AsInt32()
|
||||
.WithColumn("ProfileId").AsInt32()
|
||||
.WithColumn("MetadataProfileId").AsInt32()
|
||||
.WithColumn("Tags").AsString().Nullable();
|
||||
|
||||
Create.TableForModel("ImportListStatus")
|
||||
.WithColumn("ProviderId").AsInt32().NotNullable().Unique()
|
||||
.WithColumn("InitialFailure").AsDateTime().Nullable()
|
||||
.WithColumn("MostRecentFailure").AsDateTime().Nullable()
|
||||
.WithColumn("EscalationLevel").AsInt32().NotNullable()
|
||||
.WithColumn("DisabledTill").AsDateTime().Nullable()
|
||||
.WithColumn("LastSyncListInfo").AsString().Nullable();
|
||||
|
||||
Create.TableForModel("ImportListExclusions")
|
||||
.WithColumn("ForeignId").AsString().NotNullable().Unique()
|
||||
.WithColumn("Name").AsString().NotNullable();
|
||||
|
||||
Create.TableForModel("CustomFilters")
|
||||
.WithColumn("Type").AsString().NotNullable()
|
||||
.WithColumn("Label").AsString().NotNullable()
|
||||
.WithColumn("Filters").AsString().NotNullable();
|
||||
|
||||
Create.Index().OnTable("Albums").OnColumn("ArtistId");
|
||||
Create.Index().OnTable("Albums").OnColumn("ArtistId").Ascending()
|
||||
.OnColumn("ReleaseDate").Ascending();
|
||||
|
||||
Delete.Index().OnTable("History").OnColumn("AlbumId");
|
||||
Create.Index().OnTable("History").OnColumn("AlbumId").Ascending()
|
||||
.OnColumn("Date").Descending();
|
||||
|
||||
Delete.Index().OnTable("History").OnColumn("DownloadId");
|
||||
Create.Index().OnTable("History").OnColumn("DownloadId").Ascending()
|
||||
.OnColumn("Date").Descending();
|
||||
|
||||
Create.Index().OnTable("Artists").OnColumn("Monitored").Ascending();
|
||||
Create.Index().OnTable("Albums").OnColumn("ArtistMetadataId").Ascending();
|
||||
Create.Index().OnTable("Tracks").OnColumn("ArtistMetadataId").Ascending();
|
||||
Create.Index().OnTable("Tracks").OnColumn("AlbumReleaseId").Ascending();
|
||||
Create.Index().OnTable("Tracks").OnColumn("ForeignRecordingId").Ascending();
|
||||
|
||||
Insert.IntoTable("DelayProfiles").Row(new
|
||||
{
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(2)]
|
||||
public class add_reason_to_pending_releases : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("PendingReleases").AddColumn("Reason").AsInt32().WithDefaultValue(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(3)]
|
||||
public class add_medium_support : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("Albums").AddColumn("Media").AsString().WithDefaultValue("");
|
||||
Alter.Table("Tracks").AddColumn("MediumNumber").AsInt32().WithDefaultValue(0);
|
||||
Alter.Table("Tracks").AddColumn("AbsoluteTrackNumber").AsInt32().WithDefaultValue(0);
|
||||
|
||||
Execute.Sql("UPDATE Tracks SET AbsoluteTrackNumber = TrackNumber");
|
||||
|
||||
Delete.Column("TrackNumber").FromTable("Tracks");
|
||||
Alter.Table("Tracks").AddColumn("TrackNumber").AsString().Nullable();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,346 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using FluentMigrator;
|
||||
using Newtonsoft.Json;
|
||||
using NzbDrone.Common.Serializer;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(4)]
|
||||
public class add_various_qualites_in_profile : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Execute.Sql("UPDATE QualityDefinitions SET Title = 'MP3-160' WHERE Quality = 5"); // Change MP3-512 to MP3-160
|
||||
Execute.WithConnection(ConvertProfile);
|
||||
}
|
||||
|
||||
private void ConvertProfile(IDbConnection conn, IDbTransaction tran)
|
||||
{
|
||||
var updater = new ProfileUpdater3(conn, tran);
|
||||
|
||||
updater.AddQuality(Qualities4.WAV);
|
||||
|
||||
updater.MoveQuality(Qualities4.MP3_160, Qualities4.Unknown);
|
||||
|
||||
updater.CreateNewGroup(Qualities4.Unknown, 1000, "Trash Quality Lossy", new[]
|
||||
{
|
||||
Qualities4.MP3_080,
|
||||
Qualities4.MP3_064,
|
||||
Qualities4.MP3_056,
|
||||
Qualities4.MP3_048,
|
||||
Qualities4.MP3_040,
|
||||
Qualities4.MP3_032,
|
||||
Qualities4.MP3_024,
|
||||
Qualities4.MP3_016,
|
||||
Qualities4.MP3_008
|
||||
});
|
||||
|
||||
updater.CreateGroupAt(Qualities4.MP3_160, 1001, "Poor Quality Lossy", new[]
|
||||
{
|
||||
Qualities4.MP3_160,
|
||||
Qualities4.VORBIS_Q5,
|
||||
Qualities4.MP3_128,
|
||||
Qualities4.MP3_096,
|
||||
Qualities4.MP3_112
|
||||
}); // Group Vorbis-Q5 with MP3-160
|
||||
|
||||
updater.CreateGroupAt(Qualities4.MP3_192, 1002, "Low Quality Lossy", new[]
|
||||
{
|
||||
Qualities4.MP3_192,
|
||||
Qualities4.AAC_192,
|
||||
Qualities4.VORBIS_Q6,
|
||||
Qualities4.WMA,
|
||||
Qualities4.MP3_224
|
||||
}); // Group Vorbis-Q6, AAC 192, WMA with MP3-190
|
||||
|
||||
updater.CreateGroupAt(Qualities4.MP3_256, 1003, "Mid Quality Lossy", new[]
|
||||
{
|
||||
Qualities4.MP3_256,
|
||||
Qualities4.MP3_VBR_V2,
|
||||
Qualities4.VORBIS_Q8,
|
||||
Qualities4.VORBIS_Q7,
|
||||
Qualities4.AAC_256
|
||||
}); // Group Mp3-VBR-V2, Vorbis-Q7, Q8, AAC-256 with MP3-256
|
||||
|
||||
updater.CreateGroupAt(Qualities4.MP3_320, 1004, "High Quality Lossy", new[]
|
||||
{
|
||||
Qualities4.MP3_VBR,
|
||||
Qualities4.MP3_320,
|
||||
Qualities4.AAC_320,
|
||||
Qualities4.AAC_VBR,
|
||||
Qualities4.VORBIS_Q10,
|
||||
Qualities4.VORBIS_Q9
|
||||
}); // Group MP3-VBR-V0, AAC-VBR, Vorbis-Q10, Q9, AAC-320 with MP3-320
|
||||
|
||||
updater.CreateGroupAt(Qualities4.FLAC, 1005, "Lossless", new[]
|
||||
{
|
||||
Qualities4.FLAC,
|
||||
Qualities4.ALAC,
|
||||
Qualities4.FLAC_24
|
||||
}); // Group ALAC with FLAC
|
||||
|
||||
updater.Commit();
|
||||
}
|
||||
}
|
||||
|
||||
public class Profile4
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int Cutoff { get; set; }
|
||||
public List<ProfileItem4> Items { get; set; }
|
||||
}
|
||||
|
||||
public class ProfileItem4
|
||||
{
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
public int? Quality { get; set; }
|
||||
public List<ProfileItem4> Items { get; set; }
|
||||
public bool Allowed { get; set; }
|
||||
|
||||
public ProfileItem4()
|
||||
{
|
||||
Items = new List<ProfileItem4>();
|
||||
}
|
||||
}
|
||||
|
||||
public enum Qualities4
|
||||
{
|
||||
Unknown,
|
||||
MP3_192,
|
||||
MP3_VBR,
|
||||
MP3_256,
|
||||
MP3_320,
|
||||
MP3_160,
|
||||
FLAC,
|
||||
ALAC,
|
||||
MP3_VBR_V2,
|
||||
AAC_192,
|
||||
AAC_256,
|
||||
AAC_320,
|
||||
AAC_VBR,
|
||||
WAV,
|
||||
VORBIS_Q10,
|
||||
VORBIS_Q9,
|
||||
VORBIS_Q8,
|
||||
VORBIS_Q7,
|
||||
VORBIS_Q6,
|
||||
VORBIS_Q5,
|
||||
WMA,
|
||||
FLAC_24,
|
||||
MP3_128,
|
||||
MP3_096,
|
||||
MP3_080,
|
||||
MP3_064,
|
||||
MP3_056,
|
||||
MP3_048,
|
||||
MP3_040,
|
||||
MP3_032,
|
||||
MP3_024,
|
||||
MP3_016,
|
||||
MP3_008,
|
||||
MP3_112,
|
||||
MP3_224
|
||||
}
|
||||
|
||||
public class ProfileUpdater3
|
||||
{
|
||||
private readonly IDbConnection _connection;
|
||||
private readonly IDbTransaction _transaction;
|
||||
|
||||
private List<Profile4> _profiles;
|
||||
private HashSet<Profile4> _changedProfiles = new HashSet<Profile4>();
|
||||
|
||||
public ProfileUpdater3(IDbConnection conn, IDbTransaction tran)
|
||||
{
|
||||
_connection = conn;
|
||||
_transaction = tran;
|
||||
|
||||
_profiles = GetProfiles();
|
||||
}
|
||||
|
||||
public void Commit()
|
||||
{
|
||||
foreach (var profile in _changedProfiles)
|
||||
{
|
||||
using (var updateProfileCmd = _connection.CreateCommand())
|
||||
{
|
||||
updateProfileCmd.Transaction = _transaction;
|
||||
updateProfileCmd.CommandText =
|
||||
"UPDATE Profiles SET Name = ?, Cutoff = ?, Items = ? WHERE Id = ?";
|
||||
updateProfileCmd.AddParameter(profile.Name);
|
||||
updateProfileCmd.AddParameter(profile.Cutoff);
|
||||
updateProfileCmd.AddParameter(profile.Items.ToJson());
|
||||
updateProfileCmd.AddParameter(profile.Id);
|
||||
|
||||
updateProfileCmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
|
||||
_changedProfiles.Clear();
|
||||
}
|
||||
|
||||
public void AddQuality(Qualities4 quality)
|
||||
{
|
||||
foreach (var profile in _profiles)
|
||||
{
|
||||
profile.Items.Add(new ProfileItem4
|
||||
{
|
||||
Quality = (int)quality,
|
||||
Allowed = false
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void CreateGroupAt(Qualities4 find, int groupId, string name, Qualities4[] qualities)
|
||||
{
|
||||
foreach (var profile in _profiles)
|
||||
{
|
||||
var findIndex = profile.Items.FindIndex(v => v.Quality == (int)find);
|
||||
|
||||
if (findIndex > -1)
|
||||
{
|
||||
var findQuality = profile.Items[findIndex];
|
||||
|
||||
profile.Items.Insert(findIndex, new ProfileItem4
|
||||
{
|
||||
Id = groupId,
|
||||
Name = name,
|
||||
Quality = null,
|
||||
Items = qualities.Select(q => new ProfileItem4
|
||||
{
|
||||
Quality = (int)q,
|
||||
Allowed = findQuality.Allowed
|
||||
}).ToList(),
|
||||
Allowed = findQuality.Allowed
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the ID isn't found for some reason (mangled migration 71?)
|
||||
profile.Items.Add(new ProfileItem4
|
||||
{
|
||||
Id = groupId,
|
||||
Name = name,
|
||||
Quality = null,
|
||||
Items = qualities.Select(q => new ProfileItem4
|
||||
{
|
||||
Quality = (int)q,
|
||||
Allowed = false
|
||||
}).ToList(),
|
||||
Allowed = false
|
||||
});
|
||||
}
|
||||
|
||||
foreach (var quality in qualities)
|
||||
{
|
||||
var index = profile.Items.FindIndex(v => v.Quality == (int)quality);
|
||||
|
||||
if (index > -1)
|
||||
{
|
||||
profile.Items.RemoveAt(index);
|
||||
}
|
||||
|
||||
if (profile.Cutoff == (int)quality)
|
||||
{
|
||||
profile.Cutoff = groupId;
|
||||
}
|
||||
}
|
||||
|
||||
_changedProfiles.Add(profile);
|
||||
}
|
||||
}
|
||||
|
||||
public void CreateNewGroup(Qualities4 createafter, int groupId, string name, Qualities4[] qualities)
|
||||
{
|
||||
foreach (var profile in _profiles)
|
||||
{
|
||||
var findIndex = profile.Items.FindIndex(v => v.Quality == (int)createafter) + 1;
|
||||
|
||||
if (findIndex > -1)
|
||||
{
|
||||
profile.Items.Insert(findIndex, new ProfileItem4
|
||||
{
|
||||
Id = groupId,
|
||||
Name = name,
|
||||
Quality = null,
|
||||
Items = qualities.Select(q => new ProfileItem4
|
||||
{
|
||||
Quality = (int)q,
|
||||
Allowed = false
|
||||
}).ToList(),
|
||||
Allowed = false
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
profile.Items.Add(new ProfileItem4
|
||||
{
|
||||
Id = groupId,
|
||||
Name = name,
|
||||
Quality = null,
|
||||
Items = qualities.Select(q => new ProfileItem4
|
||||
{
|
||||
Quality = (int)q,
|
||||
Allowed = false
|
||||
}).ToList(),
|
||||
Allowed = false
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void MoveQuality(Qualities4 quality, Qualities4 moveafter)
|
||||
{
|
||||
foreach (var profile in _profiles)
|
||||
{
|
||||
var findIndex = profile.Items.FindIndex(v => v.Quality == (int)quality);
|
||||
|
||||
if (findIndex > -1)
|
||||
{
|
||||
var allowed = profile.Items[findIndex].Allowed;
|
||||
profile.Items.RemoveAt(findIndex);
|
||||
var findMoveIndex = profile.Items.FindIndex(v => v.Quality == (int)moveafter) + 1;
|
||||
profile.Items.Insert(findMoveIndex, new ProfileItem4
|
||||
{
|
||||
Quality = (int)quality,
|
||||
Allowed = allowed
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<Profile4> GetProfiles()
|
||||
{
|
||||
var profiles = new List<Profile4>();
|
||||
|
||||
using (var getProfilesCmd = _connection.CreateCommand())
|
||||
{
|
||||
getProfilesCmd.Transaction = _transaction;
|
||||
getProfilesCmd.CommandText = @"SELECT Id, Name, Cutoff, Items FROM Profiles";
|
||||
|
||||
using (var profileReader = getProfilesCmd.ExecuteReader())
|
||||
{
|
||||
while (profileReader.Read())
|
||||
{
|
||||
profiles.Add(new Profile4
|
||||
{
|
||||
Id = profileReader.GetInt32(0),
|
||||
Name = profileReader.GetString(1),
|
||||
Cutoff = profileReader.GetInt32(2),
|
||||
Items = Json.Deserialize<List<ProfileItem4>>(profileReader.GetString(3))
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return profiles;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(5)]
|
||||
public class metadata_profiles : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Create.TableForModel("MetadataProfiles")
|
||||
.WithColumn("Name").AsString().Unique()
|
||||
.WithColumn("PrimaryAlbumTypes").AsString()
|
||||
.WithColumn("SecondaryAlbumTypes").AsString();
|
||||
|
||||
Alter.Table("Artists").AddColumn("MetadataProfileId").AsInt32().WithDefaultValue(1);
|
||||
|
||||
Delete.Column("PrimaryAlbumTypes").FromTable("Artists");
|
||||
Delete.Column("SecondaryAlbumTypes").FromTable("Artists");
|
||||
|
||||
Alter.Table("Albums").AddColumn("SecondaryTypes").AsString().Nullable();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(6)]
|
||||
public class separate_automatic_and_interactive_search : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Rename.Column("EnableSearch").OnTable("Indexers").To("EnableAutomaticSearch");
|
||||
Alter.Table("Indexers").AddColumn("EnableInteractiveSearch").AsBoolean().Nullable();
|
||||
|
||||
Execute.Sql("UPDATE Indexers SET EnableInteractiveSearch = EnableAutomaticSearch");
|
||||
|
||||
Alter.Table("Indexers").AlterColumn("EnableInteractiveSearch").AsBoolean().NotNullable();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(7)]
|
||||
public class change_album_path_to_relative : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Delete.Column("Path").FromTable("Albums");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(8)]
|
||||
public class change_quality_size_mb_to_kb : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Execute.Sql("UPDATE QualityDefinitions SET MaxSize = CASE " +
|
||||
"WHEN (CAST(MaxSize AS FLOAT) / 60) * 8 * 1024 < 1500 THEN " +
|
||||
"ROUND((CAST(MaxSize AS FLOAT) / 60) * 8 * 1024, 0) " +
|
||||
"ELSE NULL " +
|
||||
"END");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(9)]
|
||||
public class album_releases : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("Albums").AddColumn("Releases").AsString().WithDefaultValue("").Nullable();
|
||||
Alter.Table("Albums").AddColumn("CurrentRelease").AsString().WithDefaultValue("").Nullable();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(10)]
|
||||
public class album_releases_fix : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("Albums").AlterColumn("Releases").AsString().NotNullable();
|
||||
Alter.Table("Albums").AlterColumn("CurrentRelease").AsString().NotNullable();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(11)]
|
||||
public class import_lists : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Create.TableForModel("ImportLists")
|
||||
.WithColumn("Name").AsString().Unique()
|
||||
.WithColumn("Implementation").AsString()
|
||||
.WithColumn("Settings").AsString().Nullable()
|
||||
.WithColumn("ConfigContract").AsString().Nullable()
|
||||
.WithColumn("EnableAutomaticAdd").AsBoolean().Nullable()
|
||||
.WithColumn("RootFolderPath").AsString()
|
||||
.WithColumn("ShouldMonitor").AsInt32()
|
||||
.WithColumn("ProfileId").AsInt32()
|
||||
.WithColumn("LanguageProfileId").AsInt32()
|
||||
.WithColumn("MetadataProfileId").AsInt32();
|
||||
|
||||
Create.TableForModel("ImportListStatus")
|
||||
.WithColumn("ProviderId").AsInt32().NotNullable().Unique()
|
||||
.WithColumn("InitialFailure").AsDateTime().Nullable()
|
||||
.WithColumn("MostRecentFailure").AsDateTime().Nullable()
|
||||
.WithColumn("EscalationLevel").AsInt32().NotNullable()
|
||||
.WithColumn("DisabledTill").AsDateTime().Nullable()
|
||||
.WithColumn("LastSyncListInfo").AsString().Nullable();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,136 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Common.Serializer;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(12)]
|
||||
public class add_release_status : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("MetadataProfiles").AddColumn("ReleaseStatuses").AsString().WithDefaultValue("");
|
||||
Execute.WithConnection(ConvertProfile);
|
||||
}
|
||||
|
||||
private void ConvertProfile(IDbConnection conn, IDbTransaction tran)
|
||||
{
|
||||
var updater = new ProfileUpdater11(conn, tran);
|
||||
updater.AddDefaultReleaseStatus();
|
||||
updater.Commit();
|
||||
}
|
||||
}
|
||||
|
||||
public class Profile12
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public List<ProfileItem12> ReleaseStatuses { get; set; }
|
||||
}
|
||||
|
||||
public class ProfileItem12
|
||||
{
|
||||
public int ReleaseStatus { get; set; }
|
||||
public bool Allowed { get; set; }
|
||||
}
|
||||
|
||||
public enum ReleaseStatus12
|
||||
{
|
||||
Official = 0,
|
||||
Promotional = 1,
|
||||
Bootleg = 2,
|
||||
Pseudo = 3
|
||||
}
|
||||
|
||||
public class ProfileUpdater11
|
||||
{
|
||||
private readonly IDbConnection _connection;
|
||||
private readonly IDbTransaction _transaction;
|
||||
|
||||
private List<Profile12> _profiles;
|
||||
|
||||
public ProfileUpdater11(IDbConnection conn, IDbTransaction tran)
|
||||
{
|
||||
_connection = conn;
|
||||
_transaction = tran;
|
||||
|
||||
_profiles = GetProfiles();
|
||||
}
|
||||
|
||||
public void Commit()
|
||||
{
|
||||
foreach (var profile in _profiles)
|
||||
{
|
||||
using (var updateProfileCmd = _connection.CreateCommand())
|
||||
{
|
||||
updateProfileCmd.Transaction = _transaction;
|
||||
updateProfileCmd.CommandText =
|
||||
"UPDATE MetadataProfiles SET ReleaseStatuses = ? WHERE Id = ?";
|
||||
updateProfileCmd.AddParameter(profile.ReleaseStatuses.ToJson());
|
||||
updateProfileCmd.AddParameter(profile.Id);
|
||||
|
||||
updateProfileCmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
|
||||
_profiles.Clear();
|
||||
}
|
||||
|
||||
public void AddDefaultReleaseStatus()
|
||||
{
|
||||
foreach (var profile in _profiles)
|
||||
{
|
||||
profile.ReleaseStatuses = new List<ProfileItem12>
|
||||
{
|
||||
new ProfileItem12
|
||||
{
|
||||
ReleaseStatus = (int)ReleaseStatus12.Official,
|
||||
Allowed = true
|
||||
},
|
||||
new ProfileItem12
|
||||
{
|
||||
ReleaseStatus = (int)ReleaseStatus12.Promotional,
|
||||
Allowed = false
|
||||
},
|
||||
new ProfileItem12
|
||||
{
|
||||
ReleaseStatus = (int)ReleaseStatus12.Bootleg,
|
||||
Allowed = false
|
||||
},
|
||||
new ProfileItem12
|
||||
{
|
||||
ReleaseStatus = (int)ReleaseStatus12.Pseudo,
|
||||
Allowed = false
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private List<Profile12> GetProfiles()
|
||||
{
|
||||
var profiles = new List<Profile12>();
|
||||
|
||||
using (var getProfilesCmd = _connection.CreateCommand())
|
||||
{
|
||||
getProfilesCmd.Transaction = _transaction;
|
||||
getProfilesCmd.CommandText = @"SELECT Id, Name FROM MetadataProfiles";
|
||||
|
||||
using (var profileReader = getProfilesCmd.ExecuteReader())
|
||||
{
|
||||
while (profileReader.Read())
|
||||
{
|
||||
profiles.Add(new Profile12
|
||||
{
|
||||
Id = profileReader.GetInt32(0),
|
||||
Name = profileReader.GetString(1)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return profiles;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(13)]
|
||||
public class album_download_notification : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("Notifications").AddColumn("OnAlbumDownload").AsBoolean().WithDefaultValue(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(14)]
|
||||
public class fix_language_metadata_profiles : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Execute.Sql("UPDATE artists SET metadataProfileId = " +
|
||||
"CASE WHEN ((SELECT COUNT(*) FROM metadataprofiles) > 0) " +
|
||||
"THEN (SELECT id FROM metadataprofiles ORDER BY id ASC LIMIT 1) " +
|
||||
"ELSE 0 END " +
|
||||
"WHERE artists.metadataProfileId == 0");
|
||||
|
||||
Execute.Sql("UPDATE artists SET languageProfileId = " +
|
||||
"CASE WHEN ((SELECT COUNT(*) FROM languageprofiles) > 0) " +
|
||||
"THEN (SELECT id FROM languageprofiles ORDER BY id ASC LIMIT 1) " +
|
||||
"ELSE 0 END " +
|
||||
"WHERE artists.languageProfileId == 0");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(15)]
|
||||
public class remove_fanzub : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Execute.Sql("DELETE FROM Indexers WHERE Implementation = 'Fanzub';");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(16)]
|
||||
public class update_artist_history_indexes : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Create.Index().OnTable("Albums").OnColumn("ArtistId");
|
||||
Create.Index().OnTable("Albums").OnColumn("ArtistId").Ascending()
|
||||
.OnColumn("ReleaseDate").Ascending();
|
||||
|
||||
Delete.Index().OnTable("History").OnColumn("AlbumId");
|
||||
Create.Index().OnTable("History").OnColumn("AlbumId").Ascending()
|
||||
.OnColumn("Date").Descending();
|
||||
|
||||
Delete.Index().OnTable("History").OnColumn("DownloadId");
|
||||
Create.Index().OnTable("History").OnColumn("DownloadId").Ascending()
|
||||
.OnColumn("Date").Descending();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(17)]
|
||||
public class remove_nma : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Delete.FromTable("Notifications").Row(new { Implementation = "NotifyMyAndroid" });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(18)]
|
||||
public class album_disambiguation : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("Albums").AddColumn("Disambiguation").AsString().Nullable();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,138 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using FluentMigrator;
|
||||
using Newtonsoft.Json;
|
||||
using NzbDrone.Common.Serializer;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(19)]
|
||||
public class add_ape_quality_in_profiles : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Execute.WithConnection(ConvertProfile);
|
||||
}
|
||||
|
||||
private void ConvertProfile(IDbConnection conn, IDbTransaction tran)
|
||||
{
|
||||
var updater = new ProfileUpdater19(conn, tran);
|
||||
|
||||
updater.SplitQualityAppend(6, 35); // APE after Flac
|
||||
updater.SplitQualityAppend(6, 36); // WavPack after Flac
|
||||
|
||||
updater.Commit();
|
||||
}
|
||||
}
|
||||
|
||||
public class Profile19
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int Cutoff { get; set; }
|
||||
public List<ProfileItem19> Items { get; set; }
|
||||
}
|
||||
|
||||
public class ProfileItem19
|
||||
{
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public int? Quality { get; set; }
|
||||
|
||||
public bool Allowed { get; set; }
|
||||
public List<ProfileItem19> Items { get; set; }
|
||||
}
|
||||
|
||||
public class ProfileUpdater19
|
||||
{
|
||||
private readonly IDbConnection _connection;
|
||||
private readonly IDbTransaction _transaction;
|
||||
|
||||
private List<Profile19> _profiles;
|
||||
private HashSet<Profile19> _changedProfiles = new HashSet<Profile19>();
|
||||
|
||||
public ProfileUpdater19(IDbConnection conn, IDbTransaction tran)
|
||||
{
|
||||
_connection = conn;
|
||||
_transaction = tran;
|
||||
|
||||
_profiles = GetProfiles();
|
||||
}
|
||||
|
||||
public void Commit()
|
||||
{
|
||||
foreach (var profile in _changedProfiles)
|
||||
{
|
||||
using (var updateProfileCmd = _connection.CreateCommand())
|
||||
{
|
||||
updateProfileCmd.Transaction = _transaction;
|
||||
updateProfileCmd.CommandText = "UPDATE Profiles SET Name = ?, Cutoff = ?, Items = ? WHERE Id = ?";
|
||||
updateProfileCmd.AddParameter(profile.Name);
|
||||
updateProfileCmd.AddParameter(profile.Cutoff);
|
||||
updateProfileCmd.AddParameter(profile.Items.ToJson());
|
||||
updateProfileCmd.AddParameter(profile.Id);
|
||||
|
||||
updateProfileCmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
|
||||
_changedProfiles.Clear();
|
||||
}
|
||||
|
||||
public void SplitQualityAppend(int find, int quality)
|
||||
{
|
||||
foreach (var profile in _profiles)
|
||||
{
|
||||
if (profile.Items.Any(v => v.Quality == quality))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var findIndex = profile.Items.FindIndex(v =>
|
||||
{
|
||||
return v.Quality == find || (v.Items != null && v.Items.Any(b => b.Quality == find));
|
||||
});
|
||||
|
||||
profile.Items.Insert(findIndex + 1, new ProfileItem19
|
||||
{
|
||||
Quality = quality,
|
||||
Allowed = false
|
||||
});
|
||||
|
||||
_changedProfiles.Add(profile);
|
||||
}
|
||||
}
|
||||
|
||||
private List<Profile19> GetProfiles()
|
||||
{
|
||||
var profiles = new List<Profile19>();
|
||||
|
||||
using (var getProfilesCmd = _connection.CreateCommand())
|
||||
{
|
||||
getProfilesCmd.Transaction = _transaction;
|
||||
getProfilesCmd.CommandText = @"SELECT Id, Name, Cutoff, Items FROM Profiles";
|
||||
|
||||
using (var profileReader = getProfilesCmd.ExecuteReader())
|
||||
{
|
||||
while (profileReader.Read())
|
||||
{
|
||||
profiles.Add(new Profile19
|
||||
{
|
||||
Id = profileReader.GetInt32(0),
|
||||
Name = profileReader.GetString(1),
|
||||
Cutoff = profileReader.GetInt32(2),
|
||||
Items = Json.Deserialize<List<ProfileItem19>>(profileReader.GetString(3))
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return profiles;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(20)]
|
||||
public class remove_pushalot : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Delete.FromTable("Notifications").Row(new { Implementation = "Pushalot" });
|
||||
Delete.FromTable("Metadata").Row(new { Implementation = "MediaBrowserMetadata" });
|
||||
Delete.FromTable("MetadataFiles").Row(new { Consumer = "MediaBrowserMetadata" });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(21)]
|
||||
public class add_custom_filters : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Create.TableForModel("CustomFilters")
|
||||
.WithColumn("Type").AsString().NotNullable()
|
||||
.WithColumn("Label").AsString().NotNullable()
|
||||
.WithColumn("Filters").AsString().NotNullable();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(22)]
|
||||
public class import_list_tags : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("ImportLists").AddColumn("Tags").AsString().Nullable();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,282 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Common.Serializer;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
using NzbDrone.Core.Music;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(23)]
|
||||
public class add_release_groups_etc : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
// ARTISTS TABLE
|
||||
Create.TableForModel("ArtistMetadata")
|
||||
.WithColumn("ForeignArtistId").AsString().Unique()
|
||||
.WithColumn("Name").AsString()
|
||||
.WithColumn("Overview").AsString().Nullable()
|
||||
.WithColumn("Disambiguation").AsString().Nullable()
|
||||
.WithColumn("Type").AsString().Nullable()
|
||||
.WithColumn("Status").AsInt32()
|
||||
.WithColumn("Images").AsString()
|
||||
.WithColumn("Links").AsString().Nullable()
|
||||
.WithColumn("Genres").AsString().Nullable()
|
||||
.WithColumn("Ratings").AsString().Nullable()
|
||||
.WithColumn("Members").AsString().Nullable();
|
||||
|
||||
// we want to preserve the artist ID. Shove all the metadata into the metadata table.
|
||||
Execute.Sql(@"INSERT INTO ArtistMetadata (ForeignArtistId, Name, Overview, Disambiguation, Type, Status, Images, Links, Genres, Ratings, Members)
|
||||
SELECT ForeignArtistId, Name, Overview, Disambiguation, ArtistType, Status, Images, Links, Genres, Ratings, Members
|
||||
FROM Artists");
|
||||
|
||||
// Add an ArtistMetadataId column to Artists
|
||||
Alter.Table("Artists").AddColumn("ArtistMetadataId").AsInt32().WithDefaultValue(0);
|
||||
|
||||
// Update artistmetadataId
|
||||
Execute.Sql(@"UPDATE Artists
|
||||
SET ArtistMetadataId = (SELECT ArtistMetadata.Id
|
||||
FROM ArtistMetadata
|
||||
WHERE ArtistMetadata.ForeignArtistId = Artists.ForeignArtistId)");
|
||||
|
||||
// ALBUM RELEASES TABLE - Do this before we mess with the Albums table
|
||||
Create.TableForModel("AlbumReleases")
|
||||
.WithColumn("ForeignReleaseId").AsString().Unique()
|
||||
.WithColumn("AlbumId").AsInt32().Indexed()
|
||||
.WithColumn("Title").AsString()
|
||||
.WithColumn("Status").AsString()
|
||||
.WithColumn("Duration").AsInt32().WithDefaultValue(0)
|
||||
.WithColumn("Label").AsString().Nullable()
|
||||
.WithColumn("Disambiguation").AsString().Nullable()
|
||||
.WithColumn("Country").AsString().Nullable()
|
||||
.WithColumn("ReleaseDate").AsDateTime().Nullable()
|
||||
.WithColumn("Media").AsString().Nullable()
|
||||
.WithColumn("TrackCount").AsInt32().Nullable()
|
||||
.WithColumn("Monitored").AsBoolean();
|
||||
|
||||
Execute.WithConnection(PopulateReleases);
|
||||
|
||||
// ALBUMS TABLE
|
||||
|
||||
// Add in the extra columns and update artist metadata id
|
||||
Alter.Table("Albums").AddColumn("ArtistMetadataId").AsInt32().WithDefaultValue(0);
|
||||
Alter.Table("Albums").AddColumn("AnyReleaseOk").AsBoolean().WithDefaultValue(true);
|
||||
Alter.Table("Albums").AddColumn("Links").AsString().Nullable();
|
||||
|
||||
// Set metadata ID
|
||||
Execute.Sql(@"UPDATE Albums
|
||||
SET ArtistMetadataId = (SELECT ArtistMetadata.Id
|
||||
FROM ArtistMetadata
|
||||
JOIN Artists ON ArtistMetadata.Id = Artists.ArtistMetadataId
|
||||
WHERE Albums.ArtistId = Artists.Id)");
|
||||
|
||||
// TRACKS TABLE
|
||||
Alter.Table("Tracks").AddColumn("ForeignRecordingId").AsString().WithDefaultValue("0");
|
||||
Alter.Table("Tracks").AddColumn("AlbumReleaseId").AsInt32().WithDefaultValue(0);
|
||||
Alter.Table("Tracks").AddColumn("ArtistMetadataId").AsInt32().WithDefaultValue(0);
|
||||
|
||||
// Set track release to the only release we've bothered populating
|
||||
Execute.Sql(@"UPDATE Tracks
|
||||
SET AlbumReleaseId = (SELECT AlbumReleases.Id
|
||||
FROM AlbumReleases
|
||||
JOIN Albums ON AlbumReleases.AlbumId = Albums.Id
|
||||
WHERE Albums.Id = Tracks.AlbumId)");
|
||||
|
||||
// Set metadata ID
|
||||
Execute.Sql(@"UPDATE Tracks
|
||||
SET ArtistMetadataId = (SELECT ArtistMetadata.Id
|
||||
FROM ArtistMetadata
|
||||
JOIN Albums ON ArtistMetadata.Id = Albums.ArtistMetadataId
|
||||
WHERE Tracks.AlbumId = Albums.Id)");
|
||||
|
||||
// CLEAR OUT OLD COLUMNS
|
||||
|
||||
// Remove the columns in Artists now in ArtistMetadata
|
||||
Delete.Column("ForeignArtistId")
|
||||
.Column("Name")
|
||||
.Column("Overview")
|
||||
.Column("Disambiguation")
|
||||
.Column("ArtistType")
|
||||
.Column("Status")
|
||||
.Column("Images")
|
||||
.Column("Links")
|
||||
.Column("Genres")
|
||||
.Column("Ratings")
|
||||
.Column("Members")
|
||||
|
||||
// as well as the ones no longer used
|
||||
.Column("MBId")
|
||||
.Column("AMId")
|
||||
.Column("TADBId")
|
||||
.Column("DiscogsId")
|
||||
.Column("NameSlug")
|
||||
.Column("LastDiskSync")
|
||||
.Column("DateFormed")
|
||||
.FromTable("Artists");
|
||||
|
||||
// Remove old columns from Albums
|
||||
Delete.Column("ArtistId")
|
||||
.Column("MBId")
|
||||
.Column("AMId")
|
||||
.Column("TADBId")
|
||||
.Column("DiscogsId")
|
||||
.Column("TitleSlug")
|
||||
.Column("Label")
|
||||
.Column("SortTitle")
|
||||
.Column("Tags")
|
||||
.Column("Duration")
|
||||
.Column("Media")
|
||||
.Column("Releases")
|
||||
.Column("CurrentRelease")
|
||||
.Column("LastDiskSync")
|
||||
.FromTable("Albums");
|
||||
|
||||
// Remove old columns from Tracks
|
||||
Delete.Column("ArtistId")
|
||||
.Column("AlbumId")
|
||||
.Column("Compilation")
|
||||
.Column("DiscNumber")
|
||||
.Column("Monitored")
|
||||
.FromTable("Tracks");
|
||||
|
||||
// Remove old columns from TrackFiles
|
||||
Delete.Column("ArtistId").FromTable("TrackFiles");
|
||||
|
||||
// Add indices
|
||||
Create.Index().OnTable("Artists").OnColumn("ArtistMetadataId").Ascending();
|
||||
Create.Index().OnTable("Artists").OnColumn("Monitored").Ascending();
|
||||
Create.Index().OnTable("Albums").OnColumn("ArtistMetadataId").Ascending();
|
||||
Create.Index().OnTable("Tracks").OnColumn("ArtistMetadataId").Ascending();
|
||||
Create.Index().OnTable("Tracks").OnColumn("AlbumReleaseId").Ascending();
|
||||
Create.Index().OnTable("Tracks").OnColumn("ForeignRecordingId").Ascending();
|
||||
|
||||
// Force a metadata refresh
|
||||
Update.Table("Artists").Set(new { LastInfoSync = new System.DateTime(2018, 1, 1, 0, 0, 1) }).AllRows();
|
||||
Update.Table("Albums").Set(new { LastInfoSync = new System.DateTime(2018, 1, 1, 0, 0, 1) }).AllRows();
|
||||
Update.Table("ScheduledTasks")
|
||||
.Set(new { LastExecution = new System.DateTime(2018, 1, 1, 0, 0, 1) })
|
||||
.Where(new { TypeName = "NzbDrone.Core.Music.Commands.RefreshArtistCommand" });
|
||||
}
|
||||
|
||||
private void PopulateReleases(IDbConnection conn, IDbTransaction tran)
|
||||
{
|
||||
var releases = ReadReleasesFromAlbums(conn, tran);
|
||||
var dupeFreeReleases = releases.DistinctBy(x => x.ForeignReleaseId).ToList();
|
||||
var duplicates = releases.Except(dupeFreeReleases);
|
||||
foreach (var release in duplicates)
|
||||
{
|
||||
release.ForeignReleaseId = release.AlbumId.ToString();
|
||||
}
|
||||
|
||||
WriteReleasesToReleases(releases, conn, tran);
|
||||
}
|
||||
|
||||
public class LegacyAlbumRelease : IEmbeddedDocument
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Title { get; set; }
|
||||
public DateTime? ReleaseDate { get; set; }
|
||||
public int TrackCount { get; set; }
|
||||
public int MediaCount { get; set; }
|
||||
public string Disambiguation { get; set; }
|
||||
public List<string> Country { get; set; }
|
||||
public string Format { get; set; }
|
||||
public List<string> Label { get; set; }
|
||||
}
|
||||
|
||||
private List<AlbumRelease> ReadReleasesFromAlbums(IDbConnection conn, IDbTransaction tran)
|
||||
{
|
||||
// need to get all the old albums
|
||||
var releases = new List<AlbumRelease>();
|
||||
|
||||
using (var getReleasesCmd = conn.CreateCommand())
|
||||
{
|
||||
getReleasesCmd.Transaction = tran;
|
||||
getReleasesCmd.CommandText = @"SELECT Id, CurrentRelease FROM Albums";
|
||||
|
||||
using (var releaseReader = getReleasesCmd.ExecuteReader())
|
||||
{
|
||||
while (releaseReader.Read())
|
||||
{
|
||||
int albumId = releaseReader.GetInt32(0);
|
||||
var albumRelease = Json.Deserialize<LegacyAlbumRelease>(releaseReader.GetString(1));
|
||||
|
||||
AlbumRelease toInsert = null;
|
||||
if (albumRelease != null)
|
||||
{
|
||||
var media = new List<Medium>();
|
||||
for (var i = 1; i <= Math.Max(albumRelease.MediaCount, 1); i++)
|
||||
{
|
||||
media.Add(new Medium { Number = i, Name = "", Format = albumRelease.Format ?? "Unknown" });
|
||||
}
|
||||
|
||||
toInsert = new AlbumRelease
|
||||
{
|
||||
AlbumId = albumId,
|
||||
ForeignReleaseId = albumRelease.Id.IsNotNullOrWhiteSpace() ? albumRelease.Id : albumId.ToString(),
|
||||
Title = albumRelease.Title.IsNotNullOrWhiteSpace() ? albumRelease.Title : "",
|
||||
Status = "",
|
||||
Duration = 0,
|
||||
Label = albumRelease.Label,
|
||||
Disambiguation = albumRelease.Disambiguation,
|
||||
Country = albumRelease.Country,
|
||||
Media = media,
|
||||
TrackCount = albumRelease.TrackCount,
|
||||
Monitored = true
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
toInsert = new AlbumRelease
|
||||
{
|
||||
AlbumId = albumId,
|
||||
ForeignReleaseId = albumId.ToString(),
|
||||
Title = "",
|
||||
Status = "",
|
||||
Label = new List<string>(),
|
||||
Country = new List<string>(),
|
||||
Media = new List<Medium> { new Medium { Name = "Unknown", Number = 1, Format = "Unknown" } },
|
||||
Monitored = true
|
||||
};
|
||||
}
|
||||
|
||||
releases.Add(toInsert);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return releases;
|
||||
}
|
||||
|
||||
private void WriteReleasesToReleases(List<AlbumRelease> releases, IDbConnection conn, IDbTransaction tran)
|
||||
{
|
||||
foreach (var release in releases)
|
||||
{
|
||||
using (var writeReleaseCmd = conn.CreateCommand())
|
||||
{
|
||||
writeReleaseCmd.Transaction = tran;
|
||||
writeReleaseCmd.CommandText =
|
||||
"INSERT INTO AlbumReleases (AlbumId, ForeignReleaseId, Title, Status, Duration, Label, Disambiguation, Country, Media, TrackCount, Monitored) " +
|
||||
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
|
||||
writeReleaseCmd.AddParameter(release.AlbumId);
|
||||
writeReleaseCmd.AddParameter(release.ForeignReleaseId);
|
||||
writeReleaseCmd.AddParameter(release.Title);
|
||||
writeReleaseCmd.AddParameter(release.Status);
|
||||
writeReleaseCmd.AddParameter(release.Duration);
|
||||
writeReleaseCmd.AddParameter(release.Label.ToJson());
|
||||
writeReleaseCmd.AddParameter(release.Disambiguation);
|
||||
writeReleaseCmd.AddParameter(release.Country.ToJson());
|
||||
writeReleaseCmd.AddParameter(release.Media.ToJson());
|
||||
writeReleaseCmd.AddParameter(release.TrackCount);
|
||||
writeReleaseCmd.AddParameter(release.Monitored);
|
||||
|
||||
writeReleaseCmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(24)]
|
||||
public class NewMediaInfoFormat : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Update.Table("TrackFiles").Set(new { MediaInfo = "" }).AllRows();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(25)]
|
||||
public class rename_restrictions_to_release_profiles : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Rename.Table("Restrictions").To("ReleaseProfiles");
|
||||
Alter.Table("ReleaseProfiles").AddColumn("IncludePreferredWhenRenaming").AsBoolean().WithDefaultValue(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(26)]
|
||||
public class rename_quality_profiles_add_upgrade_allowed : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Rename.Table("Profiles").To("QualityProfiles");
|
||||
|
||||
Alter.Table("QualityProfiles").AddColumn("UpgradeAllowed").AsInt32().Nullable();
|
||||
Alter.Table("LanguageProfiles").AddColumn("UpgradeAllowed").AsInt32().Nullable();
|
||||
|
||||
// Set upgrade allowed for existing profiles (default will be false for new profiles)
|
||||
Update.Table("QualityProfiles").Set(new { UpgradeAllowed = true }).AllRows();
|
||||
Update.Table("LanguageProfiles").Set(new { UpgradeAllowed = true }).AllRows();
|
||||
|
||||
Rename.Column("ProfileId").OnTable("Artists").To("QualityProfileId");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(27)]
|
||||
public class add_import_exclusions : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Create.TableForModel("ImportListExclusions")
|
||||
.WithColumn("ForeignId").AsString().NotNullable().Unique()
|
||||
.WithColumn("Name").AsString().NotNullable();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(28)]
|
||||
public class clean_artist_metadata_table : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
// Remove any artists linked to missing metadata
|
||||
Execute.Sql(@"DELETE FROM Artists
|
||||
WHERE Id in (
|
||||
SELECT Artists.Id from Artists
|
||||
LEFT OUTER JOIN ArtistMetadata ON Artists.ArtistMetadataId = ArtistMetadata.Id
|
||||
WHERE ArtistMetadata.Id IS NULL)");
|
||||
|
||||
// Remove any albums linked to missing metadata
|
||||
Execute.Sql(@"DELETE FROM Albums
|
||||
WHERE Id in (
|
||||
SELECT Albums.Id from Albums
|
||||
LEFT OUTER JOIN ArtistMetadata ON Albums.ArtistMetadataId = ArtistMetadata.Id
|
||||
WHERE ArtistMetadata.Id IS NULL)");
|
||||
|
||||
// Remove any album releases linked to albums that were deleted
|
||||
Execute.Sql(@"DELETE FROM AlbumReleases
|
||||
WHERE Id in (
|
||||
SELECT AlbumReleases.Id from AlbumReleases
|
||||
LEFT OUTER JOIN Albums ON Albums.Id = AlbumReleases.AlbumId
|
||||
WHERE Albums.Id IS NULL)");
|
||||
|
||||
// Remove any tracks linked to album releases that were deleted
|
||||
Execute.Sql(@"DELETE FROM Tracks
|
||||
WHERE Id in (
|
||||
SELECT Tracks.Id from Tracks
|
||||
LEFT OUTER JOIN AlbumReleases ON Tracks.AlbumReleaseId = AlbumReleases.Id
|
||||
WHERE AlbumReleases.Id IS NULL)");
|
||||
|
||||
// Remove any tracks linked to the original missing metadata
|
||||
Execute.Sql(@"DELETE FROM Tracks
|
||||
WHERE Id in (
|
||||
SELECT Tracks.Id from Tracks
|
||||
LEFT OUTER JOIN ArtistMetadata ON Tracks.ArtistMetadataId = ArtistMetadata.Id
|
||||
WHERE ArtistMetadata.Id IS NULL)");
|
||||
|
||||
// Remove any trackfiles linked to the deleted tracks
|
||||
Execute.Sql(@"DELETE FROM TrackFiles
|
||||
WHERE Id IN (
|
||||
SELECT TrackFiles.Id FROM TrackFiles
|
||||
LEFT OUTER JOIN Tracks
|
||||
ON TrackFiles.Id = Tracks.TrackFileId
|
||||
WHERE Tracks.Id IS NULL)");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
using FluentMigrator;
|
||||
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(29)]
|
||||
public class health_issue_notification : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("Notifications").AddColumn("OnHealthIssue").AsBoolean().WithDefaultValue(0);
|
||||
Alter.Table("Notifications").AddColumn("IncludeHealthWarnings").AsBoolean().WithDefaultValue(0);
|
||||
Alter.Table("Notifications").AddColumn("OnDownloadFailure").AsBoolean().WithDefaultValue(0);
|
||||
Alter.Table("Notifications").AddColumn("OnImportFailure").AsBoolean().WithDefaultValue(0);
|
||||
Alter.Table("Notifications").AddColumn("OnTrackRetag").AsBoolean().WithDefaultValue(0);
|
||||
|
||||
Delete.Column("OnDownload").FromTable("Notifications");
|
||||
|
||||
Rename.Column("OnAlbumDownload").OnTable("Notifications").To("OnReleaseImport");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
using System;
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(30)]
|
||||
public class add_mediafilerepository_mtime : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("TrackFiles").AddColumn("Modified").AsDateTime().WithDefaultValue(new DateTime(2000, 1, 1));
|
||||
Alter.Table("TrackFiles").AddColumn("Path").AsString().Nullable();
|
||||
|
||||
// Remove anything where RelativePath is null
|
||||
Execute.Sql(@"DELETE FROM TrackFiles WHERE RelativePath IS NULL");
|
||||
|
||||
// Remove anything not linked to a track (these shouldn't be present in version < 30)
|
||||
Execute.Sql(@"DELETE FROM TrackFiles
|
||||
WHERE Id IN (
|
||||
SELECT TrackFiles.Id FROM TrackFiles
|
||||
LEFT JOIN Tracks ON TrackFiles.Id = Tracks.TrackFileId
|
||||
WHERE Tracks.Id IS NULL)");
|
||||
|
||||
// Remove anything where we can't get an artist path (i.e. we don't know where it is)
|
||||
Execute.Sql(@"DELETE FROM TrackFiles
|
||||
WHERE Id IN (
|
||||
SELECT TrackFiles.Id FROM TrackFiles
|
||||
LEFT JOIN Albums ON TrackFiles.AlbumId = Albums.Id
|
||||
LEFT JOIN Artists on Artists.ArtistMetadataId = Albums.ArtistMetadataId
|
||||
WHERE Artists.Path IS NULL)");
|
||||
|
||||
// Remove anything linked to unmonitored or unidentified releases. This should ensure uniqueness of track files.
|
||||
Execute.Sql(@"DELETE FROM TrackFiles
|
||||
WHERE Id IN (
|
||||
SELECT TrackFiles.Id FROM TrackFiles
|
||||
LEFT JOIN Tracks ON TrackFiles.Id = Tracks.TrackFileId
|
||||
LEFT JOIN AlbumReleases ON Tracks.AlbumReleaseId = AlbumReleases.Id
|
||||
WHERE AlbumReleases.Monitored = 0
|
||||
OR AlbumReleases.Monitored IS NULL)");
|
||||
|
||||
// Populate the full paths
|
||||
Execute.Sql(@"UPDATE TrackFiles
|
||||
SET Path = (SELECT Artists.Path || '" + System.IO.Path.DirectorySeparatorChar + @"' || TrackFiles.RelativePath
|
||||
FROM Artists
|
||||
JOIN Albums ON Albums.ArtistMetadataId = Artists.ArtistMetadataId
|
||||
WHERE TrackFiles.AlbumId = Albums.Id)");
|
||||
|
||||
// Belt and braces to ensure uniqueness
|
||||
Execute.Sql(@"DELETE FROM TrackFiles
|
||||
WHERE rowid NOT IN (
|
||||
SELECT min(rowid)
|
||||
FROM TrackFiles
|
||||
GROUP BY Path
|
||||
)");
|
||||
|
||||
// Now enforce the uniqueness constraint
|
||||
Alter.Table("TrackFiles").AlterColumn("Path").AsString().NotNullable().Unique();
|
||||
|
||||
// Finally delete the relative path column
|
||||
Delete.Column("RelativePath").FromTable("TrackFiles");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(31)]
|
||||
public class add_artistmetadataid_constraint : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
// Remove any duplicate artists
|
||||
Execute.Sql(@"DELETE FROM Artists
|
||||
WHERE Id NOT IN (
|
||||
SELECT MIN(Artists.id) from Artists
|
||||
JOIN ArtistMetadata ON Artists.ArtistMetadataId = ArtistMetadata.Id
|
||||
GROUP BY ArtistMetadata.Id)");
|
||||
|
||||
// The index exists but will be recreated as part of unique constraint
|
||||
Delete.Index().OnTable("Artists").OnColumn("ArtistMetadataId");
|
||||
|
||||
// Add a constraint to prevent any more duplicates
|
||||
Alter.Column("ArtistMetadataId").OnTable("Artists").AsInt32().Unique();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(32)]
|
||||
public class old_ids_and_artist_alias : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("ArtistMetadata").AddColumn("Aliases").AsString().WithDefaultValue("[]");
|
||||
|
||||
Alter.Table("ArtistMetadata").AddColumn("OldForeignArtistIds").AsString().WithDefaultValue("[]");
|
||||
Alter.Table("Albums").AddColumn("OldForeignAlbumIds").AsString().WithDefaultValue("[]");
|
||||
Alter.Table("AlbumReleases").AddColumn("OldForeignReleaseIds").AsString().WithDefaultValue("[]");
|
||||
Alter.Table("Tracks").AddColumn("OldForeignRecordingIds").AsString().WithDefaultValue("[]");
|
||||
Alter.Table("Tracks").AddColumn("OldForeignTrackIds").AsString().WithDefaultValue("[]");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
using System.Data;
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(33)]
|
||||
public class download_propers_config : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Execute.WithConnection(SetConfigValue);
|
||||
Execute.Sql("DELETE FROM Config WHERE Key = 'autodownloadpropers'");
|
||||
}
|
||||
|
||||
private void SetConfigValue(IDbConnection conn, IDbTransaction tran)
|
||||
{
|
||||
using (var cmd = conn.CreateCommand())
|
||||
{
|
||||
cmd.Transaction = tran;
|
||||
cmd.CommandText = "SELECT Value FROM Config WHERE Key = 'autodownloadpropers'";
|
||||
|
||||
using (var reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
var value = reader.GetString(0);
|
||||
var newValue = bool.Parse(value) ? "PreferAndUpgrade" : "DoNotUpgrade";
|
||||
|
||||
using (var updateCmd = conn.CreateCommand())
|
||||
{
|
||||
updateCmd.Transaction = tran;
|
||||
updateCmd.CommandText = "INSERT INTO Config (key, value) VALUES ('downloadpropersandrepacks', ?)";
|
||||
updateCmd.AddParameter(newValue);
|
||||
|
||||
updateCmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(34)]
|
||||
public class remove_language_profiles : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Delete.Table("LanguageProfiles");
|
||||
|
||||
Delete.Column("LanguageProfileId").FromTable("Artists");
|
||||
Delete.Column("LanguageProfileId").FromTable("ImportLists");
|
||||
Delete.Column("Language").FromTable("Blacklist");
|
||||
Delete.Column("Language").FromTable("History");
|
||||
Delete.Column("Language").FromTable("LyricFiles");
|
||||
Delete.Column("Language").FromTable("TrackFiles");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(35)]
|
||||
public class multi_disc_naming_format : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("NamingConfig").AddColumn("MultiDiscTrackFormat").AsString().Nullable();
|
||||
Execute.Sql("UPDATE NamingConfig SET MultiDiscTrackFormat = '{Medium Format} {medium:00}/{Artist Name} - {Album Title} - {track:00} - {Track Title}'");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(36)]
|
||||
public class add_download_client_priority : NzbDroneMigrationBase
|
||||
{
|
||||
// Need snapshot in time without having to instantiate.
|
||||
private static HashSet<string> _usenetImplementations = new HashSet<string>
|
||||
{
|
||||
"Sabnzbd", "NzbGet", "NzbVortex", "UsenetBlackhole", "UsenetDownloadStation"
|
||||
};
|
||||
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("DownloadClients").AddColumn("Priority").AsInt32().WithDefaultValue(1);
|
||||
Execute.WithConnection(InitPriorityForBackwardCompatibility);
|
||||
}
|
||||
|
||||
private void InitPriorityForBackwardCompatibility(IDbConnection conn, IDbTransaction tran)
|
||||
{
|
||||
using (var cmd = conn.CreateCommand())
|
||||
{
|
||||
cmd.Transaction = tran;
|
||||
cmd.CommandText = "SELECT Id, Implementation FROM DownloadClients WHERE Enable = 1";
|
||||
|
||||
using (var reader = cmd.ExecuteReader())
|
||||
{
|
||||
int nextUsenet = 1;
|
||||
int nextTorrent = 1;
|
||||
while (reader.Read())
|
||||
{
|
||||
var id = reader.GetInt32(0);
|
||||
var implName = reader.GetString(1);
|
||||
|
||||
var isUsenet = _usenetImplementations.Contains(implName);
|
||||
|
||||
using (var updateCmd = conn.CreateCommand())
|
||||
{
|
||||
updateCmd.Transaction = tran;
|
||||
updateCmd.CommandText = "UPDATE DownloadClients SET Priority = ? WHERE Id = ?";
|
||||
updateCmd.AddParameter(isUsenet ? nextUsenet++ : nextTorrent++);
|
||||
updateCmd.AddParameter(id);
|
||||
|
||||
updateCmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(37)]
|
||||
public class remove_growl_prowl : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Delete.FromTable("Notifications").Row(new { Implementation = "Growl" });
|
||||
Delete.FromTable("Notifications").Row(new { Implementation = "Prowl" });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(38)]
|
||||
public class remove_plex_hometheatre : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Delete.FromTable("Notifications").Row(new { Implementation = "PlexHomeTheater" });
|
||||
Delete.FromTable("Notifications").Row(new { Implementation = "PlexClient" });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
using System.Data;
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(39)]
|
||||
public class add_root_folder_add_defaults : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("RootFolders").AddColumn("Name").AsString().Nullable();
|
||||
Alter.Table("RootFolders").AddColumn("DefaultMetadataProfileId").AsInt32().WithDefaultValue(0);
|
||||
Alter.Table("RootFolders").AddColumn("DefaultQualityProfileId").AsInt32().WithDefaultValue(0);
|
||||
Alter.Table("RootFolders").AddColumn("DefaultMonitorOption").AsInt32().WithDefaultValue(0);
|
||||
Alter.Table("RootFolders").AddColumn("DefaultTags").AsString().Nullable();
|
||||
|
||||
Execute.WithConnection(SetDefaultOptions);
|
||||
}
|
||||
|
||||
private void SetDefaultOptions(IDbConnection conn, IDbTransaction tran)
|
||||
{
|
||||
int metadataId = GetMinProfileId(conn, tran, "MetadataProfiles");
|
||||
int qualityId = GetMinProfileId(conn, tran, "QualityProfiles");
|
||||
|
||||
if (metadataId == 0 || qualityId == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
using (var cmd = conn.CreateCommand())
|
||||
{
|
||||
cmd.Transaction = tran;
|
||||
cmd.CommandText = $"SELECT Id, Path FROM RootFolders";
|
||||
|
||||
using (var reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
var rootFolderId = reader.GetInt32(0);
|
||||
var path = reader.GetString(1);
|
||||
|
||||
using (var updateCmd = conn.CreateCommand())
|
||||
{
|
||||
updateCmd.Transaction = tran;
|
||||
updateCmd.CommandText = "UPDATE RootFolders SET Name = ?, DefaultMetadataProfileId = ?, DefaultQualityProfileId = ?, DefaultTags = ? WHERE Id = ?";
|
||||
updateCmd.AddParameter(path);
|
||||
updateCmd.AddParameter(metadataId);
|
||||
updateCmd.AddParameter(qualityId);
|
||||
updateCmd.AddParameter("[]");
|
||||
updateCmd.AddParameter(rootFolderId);
|
||||
|
||||
updateCmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int GetMinProfileId(IDbConnection conn, IDbTransaction tran, string table)
|
||||
{
|
||||
using (var cmd = conn.CreateCommand())
|
||||
{
|
||||
cmd.Transaction = tran;
|
||||
|
||||
// A plain min(id) will return an empty row if table is empty which is a pain to deal with
|
||||
cmd.CommandText = $"SELECT COALESCE(MIN(Id), 0) FROM {table}";
|
||||
|
||||
using (var reader = cmd.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
return reader.GetInt32(0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(40)]
|
||||
public class task_duration : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("ScheduledTasks").AddColumn("LastStartTime").AsDateTime().Nullable();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -89,7 +89,7 @@ namespace NzbDrone.Core.Download.Clients.Blackhole
|
||||
{
|
||||
DownloadClient = Definition.Name,
|
||||
DownloadId = Definition.Name + "_" + item.DownloadId,
|
||||
Category = "Lidarr",
|
||||
Category = "Readarr",
|
||||
Title = item.Title,
|
||||
|
||||
TotalSize = item.TotalSize,
|
||||
|
||||
@@ -28,10 +28,10 @@ namespace NzbDrone.Core.Download.Clients.Blackhole
|
||||
|
||||
private static readonly TorrentBlackholeSettingsValidator Validator = new TorrentBlackholeSettingsValidator();
|
||||
|
||||
[FieldDefinition(0, Label = "Torrent Folder", Type = FieldType.Path, HelpText = "Folder in which Lidarr will store the .torrent file")]
|
||||
[FieldDefinition(0, Label = "Torrent Folder", Type = FieldType.Path, HelpText = "Folder in which Readarr will store the .torrent file")]
|
||||
public string TorrentFolder { get; set; }
|
||||
|
||||
[FieldDefinition(1, Label = "Watch Folder", Type = FieldType.Path, HelpText = "Folder from which Lidarr should import completed downloads")]
|
||||
[FieldDefinition(1, Label = "Watch Folder", Type = FieldType.Path, HelpText = "Folder from which Readarr should import completed downloads")]
|
||||
public string WatchFolder { get; set; }
|
||||
|
||||
[DefaultValue(false)]
|
||||
@@ -44,7 +44,7 @@ namespace NzbDrone.Core.Download.Clients.Blackhole
|
||||
|
||||
[DefaultValue(false)]
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
||||
[FieldDefinition(4, Label = "Read Only", Type = FieldType.Checkbox, HelpText = "Instead of moving files this will instruct Lidarr to Copy or Hardlink (depending on settings/system configuration)")]
|
||||
[FieldDefinition(4, Label = "Read Only", Type = FieldType.Checkbox, HelpText = "Instead of moving files this will instruct Readarr to Copy or Hardlink (depending on settings/system configuration)")]
|
||||
public bool ReadOnly { get; set; }
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace NzbDrone.Core.Download.Clients.Blackhole
|
||||
{
|
||||
DownloadClient = Definition.Name,
|
||||
DownloadId = Definition.Name + "_" + item.DownloadId,
|
||||
Category = "Lidarr",
|
||||
Category = "Readarr",
|
||||
Title = item.Title,
|
||||
|
||||
TotalSize = item.TotalSize,
|
||||
|
||||
@@ -19,10 +19,10 @@ namespace NzbDrone.Core.Download.Clients.Blackhole
|
||||
{
|
||||
private static readonly UsenetBlackholeSettingsValidator Validator = new UsenetBlackholeSettingsValidator();
|
||||
|
||||
[FieldDefinition(0, Label = "Nzb Folder", Type = FieldType.Path, HelpText = "Folder in which Lidarr will store the .nzb file")]
|
||||
[FieldDefinition(0, Label = "Nzb Folder", Type = FieldType.Path, HelpText = "Folder in which Readarr will store the .nzb file")]
|
||||
public string NzbFolder { get; set; }
|
||||
|
||||
[FieldDefinition(1, Label = "Watch Folder", Type = FieldType.Path, HelpText = "Folder from which Lidarr should import completed downloads")]
|
||||
[FieldDefinition(1, Label = "Watch Folder", Type = FieldType.Path, HelpText = "Folder from which Readarr should import completed downloads")]
|
||||
public string WatchFolder { get; set; }
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
|
||||
@@ -253,12 +253,12 @@ namespace NzbDrone.Core.Download.Clients.Deluge
|
||||
case WebExceptionStatus.ConnectionClosed:
|
||||
return new NzbDroneValidationFailure("UseSsl", "Verify SSL settings")
|
||||
{
|
||||
DetailedDescription = "Please verify your SSL configuration on both Deluge and Lidarr."
|
||||
DetailedDescription = "Please verify your SSL configuration on both Deluge and Readarr."
|
||||
};
|
||||
case WebExceptionStatus.SecureChannelFailure:
|
||||
return new NzbDroneValidationFailure("UseSsl", "Unable to connect through SSL")
|
||||
{
|
||||
DetailedDescription = "Lidarr is unable to connect to Deluge using SSL. This problem could be computer related. Please try to configure both drone and Deluge to not use SSL."
|
||||
DetailedDescription = "Readarr is unable to connect to Deluge using SSL. This problem could be computer related. Please try to configure both drone and Deluge to not use SSL."
|
||||
};
|
||||
default:
|
||||
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
|
||||
@@ -301,7 +301,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge
|
||||
{
|
||||
return new NzbDroneValidationFailure("MusicCategory", "Configuration of label failed")
|
||||
{
|
||||
DetailedDescription = "Lidarr was unable to add the label to Deluge."
|
||||
DetailedDescription = "Readarr was unable to add the label to Deluge."
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -315,7 +315,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge
|
||||
{
|
||||
return new NzbDroneValidationFailure("MusicImportedCategory", "Configuration of label failed")
|
||||
{
|
||||
DetailedDescription = "Lidarr was unable to add the label to Deluge."
|
||||
DetailedDescription = "Readarr was unable to add the label to Deluge."
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge
|
||||
Host = "localhost";
|
||||
Port = 8112;
|
||||
Password = "deluge";
|
||||
MusicCategory = "lidarr";
|
||||
MusicCategory = "readarr";
|
||||
}
|
||||
|
||||
[FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)]
|
||||
@@ -41,10 +41,10 @@ namespace NzbDrone.Core.Download.Clients.Deluge
|
||||
[FieldDefinition(3, Label = "Password", Type = FieldType.Password)]
|
||||
public string Password { get; set; }
|
||||
|
||||
[FieldDefinition(4, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional")]
|
||||
[FieldDefinition(4, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Readarr avoids conflicts with unrelated downloads, but it's optional")]
|
||||
public string MusicCategory { get; set; }
|
||||
|
||||
[FieldDefinition(5, Label = "Post-Import Category", Type = FieldType.Textbox, Advanced = true, HelpText = "Category for Lidarr to set after it has imported the download. Leave blank to disable this feature.")]
|
||||
[FieldDefinition(5, Label = "Post-Import Category", Type = FieldType.Textbox, Advanced = true, HelpText = "Category for Readarr to set after it has imported the download. Leave blank to disable this feature.")]
|
||||
public string MusicImportedCategory { get; set; }
|
||||
|
||||
[FieldDefinition(6, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(DelugePriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")]
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
|
||||
[FieldDefinition(3, Label = "Password", Type = FieldType.Password)]
|
||||
public string Password { get; set; }
|
||||
|
||||
[FieldDefinition(4, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional. Creates a [category] subdirectory in the output directory.")]
|
||||
[FieldDefinition(4, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Readarr avoids conflicts with unrelated downloads, but it's optional. Creates a [category] subdirectory in the output directory.")]
|
||||
public string MusicCategory { get; set; }
|
||||
|
||||
[FieldDefinition(5, Label = "Directory", Type = FieldType.Textbox, HelpText = "Optional shared folder to put downloads into, leave blank to use the default Download Station location")]
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
|
||||
|
||||
public override string Name => "Download Station";
|
||||
|
||||
public override ProviderMessage Message => new ProviderMessage("Lidarr is unable to connect to Download Station if 2-Factor Authentication is enabled on your DSM account", ProviderMessageType.Warning);
|
||||
public override ProviderMessage Message => new ProviderMessage("Readarr is unable to connect to Download Station if 2-Factor Authentication is enabled on your DSM account", ProviderMessageType.Warning);
|
||||
|
||||
protected IEnumerable<DownloadStationTask> GetTasks()
|
||||
{
|
||||
@@ -368,7 +368,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
|
||||
_logger.Error(ex, "Unable to authenticate");
|
||||
return new NzbDroneValidationFailure("Username", "Authentication failure")
|
||||
{
|
||||
DetailedDescription = $"Please verify your username and password. Also verify if the host running Lidarr isn't blocked from accessing {Name} by WhiteList limitations in the {Name} configuration."
|
||||
DetailedDescription = $"Please verify your username and password. Also verify if the host running Readarr isn't blocked from accessing {Name} by WhiteList limitations in the {Name} configuration."
|
||||
};
|
||||
}
|
||||
catch (WebException ex)
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
|
||||
|
||||
public override string Name => "Download Station";
|
||||
|
||||
public override ProviderMessage Message => new ProviderMessage("Lidarr is unable to connect to Download Station if 2-Factor Authentication is enabled on your DSM account", ProviderMessageType.Warning);
|
||||
public override ProviderMessage Message => new ProviderMessage("Readarr is unable to connect to Download Station if 2-Factor Authentication is enabled on your DSM account", ProviderMessageType.Warning);
|
||||
|
||||
protected IEnumerable<DownloadStationTask> GetTasks()
|
||||
{
|
||||
@@ -266,7 +266,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
|
||||
_logger.Error(ex, "Unable to authenticate");
|
||||
return new NzbDroneValidationFailure("Username", "Authentication failure")
|
||||
{
|
||||
DetailedDescription = $"Please verify your username and password. Also verify if the host running Lidarr isn't blocked from accessing {Name} by WhiteList limitations in the {Name} configuration."
|
||||
DetailedDescription = $"Please verify your username and password. Also verify if the host running Readarr isn't blocked from accessing {Name} by WhiteList limitations in the {Name} configuration."
|
||||
};
|
||||
}
|
||||
catch (WebException ex)
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace NzbDrone.Core.Download.Clients.Hadouken
|
||||
{
|
||||
Host = "localhost";
|
||||
Port = 7070;
|
||||
Category = "lidarr-music";
|
||||
Category = "readarr-music";
|
||||
}
|
||||
|
||||
[FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)]
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex
|
||||
[FieldDefinition(3, Label = "API Key", Type = FieldType.Textbox)]
|
||||
public string ApiKey { get; set; }
|
||||
|
||||
[FieldDefinition(4, Label = "Group", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional")]
|
||||
[FieldDefinition(4, Label = "Group", Type = FieldType.Textbox, HelpText = "Adding a category specific to Readarr avoids conflicts with unrelated downloads, but it's optional")]
|
||||
public string MusicCategory { get; set; }
|
||||
|
||||
[FieldDefinition(5, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(NzbVortexPriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")]
|
||||
|
||||
@@ -309,7 +309,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
|
||||
return new NzbDroneValidationFailure(string.Empty, "NzbGet setting KeepHistory should be greater than 0")
|
||||
{
|
||||
InfoLink = _proxy.GetBaseUrl(Settings),
|
||||
DetailedDescription = "NzbGet setting KeepHistory is set to 0. Which prevents Lidarr from seeing completed downloads."
|
||||
DetailedDescription = "NzbGet setting KeepHistory is set to 0. Which prevents Readarr from seeing completed downloads."
|
||||
};
|
||||
}
|
||||
else if (value > 25000)
|
||||
|
||||
@@ -170,7 +170,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
|
||||
|
||||
if (id.Length < 10 && int.TryParse(id, out nzbId))
|
||||
{
|
||||
// Download wasn't grabbed by Lidarr, so the id is the NzbId reported by nzbget.
|
||||
// Download wasn't grabbed by Readarr, so the id is the NzbId reported by nzbget.
|
||||
queueItem = queue.SingleOrDefault(h => h.NzbId == nzbId);
|
||||
historyItem = history.SingleOrDefault(h => h.Id == nzbId);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
|
||||
[FieldDefinition(4, Label = "Password", Type = FieldType.Password)]
|
||||
public string Password { get; set; }
|
||||
|
||||
[FieldDefinition(5, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional")]
|
||||
[FieldDefinition(5, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Readarr avoids conflicts with unrelated downloads, but it's optional")]
|
||||
public string MusicCategory { get; set; }
|
||||
|
||||
[FieldDefinition(6, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(NzbgetPriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")]
|
||||
|
||||
@@ -275,7 +275,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
|
||||
return new NzbDroneValidationFailure("MusicCategory", "Category is recommended")
|
||||
{
|
||||
IsWarning = true,
|
||||
DetailedDescription = "Lidarr will not attempt to import completed downloads without a category."
|
||||
DetailedDescription = "Readarr will not attempt to import completed downloads without a category."
|
||||
};
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
|
||||
{
|
||||
return new NzbDroneValidationFailure(string.Empty, "qBittorrent is configured to remove torrents when they reach their Share Ratio Limit")
|
||||
{
|
||||
DetailedDescription = "Lidarr will be unable to perform Completed Download Handling as configured. You can fix this in qBittorrent ('Tools -> Options...' in the menu) by changing 'Options -> BitTorrent -> Share Ratio Limiting' from 'Remove them' to 'Pause them'."
|
||||
DetailedDescription = "Readarr will be unable to perform Completed Download Handling as configured. You can fix this in qBittorrent ('Tools -> Options...' in the menu) by changing 'Options -> BitTorrent -> Share Ratio Limiting' from 'Remove them' to 'Pause them'."
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -344,7 +344,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
|
||||
{
|
||||
return new NzbDroneValidationFailure("MusicCategory", "Configuration of label failed")
|
||||
{
|
||||
DetailedDescription = "Lidarr was unable to add the label to qBittorrent."
|
||||
DetailedDescription = "Readarr was unable to add the label to qBittorrent."
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -358,7 +358,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
|
||||
{
|
||||
return new NzbDroneValidationFailure("MusicImportedCategory", "Configuration of label failed")
|
||||
{
|
||||
DetailedDescription = "Lidarr was unable to add the label to qBittorrent."
|
||||
DetailedDescription = "Readarr was unable to add the label to qBittorrent."
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
|
||||
{
|
||||
Host = "localhost";
|
||||
Port = 8080;
|
||||
MusicCategory = "lidarr";
|
||||
MusicCategory = "readarr";
|
||||
}
|
||||
|
||||
[FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)]
|
||||
@@ -45,10 +45,10 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
|
||||
[FieldDefinition(4, Label = "Password", Type = FieldType.Password)]
|
||||
public string Password { get; set; }
|
||||
|
||||
[FieldDefinition(5, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional")]
|
||||
[FieldDefinition(5, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Readarr avoids conflicts with unrelated downloads, but it's optional")]
|
||||
public string MusicCategory { get; set; }
|
||||
|
||||
[FieldDefinition(6, Label = "Post-Import Category", Type = FieldType.Textbox, Advanced = true, HelpText = "Category for Lidarr to set after it has imported the download. Leave blank to disable this feature.")]
|
||||
[FieldDefinition(6, Label = "Post-Import Category", Type = FieldType.Textbox, Advanced = true, HelpText = "Category for Readarr to set after it has imported the download. Leave blank to disable this feature.")]
|
||||
public string MusicImportedCategory { get; set; }
|
||||
|
||||
[FieldDefinition(7, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(QBittorrentPriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")]
|
||||
|
||||
@@ -357,7 +357,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
|
||||
return new NzbDroneValidationFailure("Version", "Sabnzbd develop version, assuming version 1.1.0 or higher.")
|
||||
{
|
||||
IsWarning = true,
|
||||
DetailedDescription = "Lidarr may not be able to support new features added to SABnzbd when running develop versions."
|
||||
DetailedDescription = "Readarr may not be able to support new features added to SABnzbd when running develop versions."
|
||||
};
|
||||
}
|
||||
|
||||
@@ -412,7 +412,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
|
||||
return new NzbDroneValidationFailure("", "Disable 'Check before download' option in Sabnbzd")
|
||||
{
|
||||
InfoLink = _proxy.GetBaseUrl(Settings, "config/switches/"),
|
||||
DetailedDescription = "Using Check before download affects Lidarr ability to track new downloads. Also Sabnzbd recommends 'Abort jobs that cannot be completed' instead since it's more effective."
|
||||
DetailedDescription = "Using Check before download affects Readarr ability to track new downloads. Also Sabnzbd recommends 'Abort jobs that cannot be completed' instead since it's more effective."
|
||||
};
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
|
||||
return new NzbDroneValidationFailure("MusicCategory", "Enable Job folders")
|
||||
{
|
||||
InfoLink = _proxy.GetBaseUrl(Settings, "config/categories/"),
|
||||
DetailedDescription = "Lidarr prefers each download to have a separate folder. With * appended to the Folder/Path Sabnzbd will not create these job folders. Go to Sabnzbd to fix it."
|
||||
DetailedDescription = "Readarr prefers each download to have a separate folder. With * appended to the Folder/Path Sabnzbd will not create these job folders. Go to Sabnzbd to fix it."
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -452,7 +452,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
|
||||
return new NzbDroneValidationFailure("MusicCategory", "Disable TV Sorting")
|
||||
{
|
||||
InfoLink = _proxy.GetBaseUrl(Settings, "config/sorting/"),
|
||||
DetailedDescription = "You must disable Sabnzbd TV Sorting for the category Lidarr uses to prevent import issues. Go to Sabnzbd to fix it."
|
||||
DetailedDescription = "You must disable Sabnzbd TV Sorting for the category Readarr uses to prevent import issues. Go to Sabnzbd to fix it."
|
||||
};
|
||||
}
|
||||
|
||||
@@ -461,7 +461,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
|
||||
return new NzbDroneValidationFailure("MusicCategory", "Disable Movie Sorting")
|
||||
{
|
||||
InfoLink = _proxy.GetBaseUrl(Settings, "config/sorting/"),
|
||||
DetailedDescription = "You must disable Sabnzbd Movie Sorting for the category Lidarr uses to prevent import issues. Go to Sabnzbd to fix it."
|
||||
DetailedDescription = "You must disable Sabnzbd Movie Sorting for the category Readarr uses to prevent import issues. Go to Sabnzbd to fix it."
|
||||
};
|
||||
}
|
||||
|
||||
@@ -470,7 +470,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
|
||||
return new NzbDroneValidationFailure("MusicCategory", "Disable Date Sorting")
|
||||
{
|
||||
InfoLink = _proxy.GetBaseUrl(Settings, "config/sorting/"),
|
||||
DetailedDescription = "You must disable Sabnzbd Date Sorting for the category Lidarr uses to prevent import issues. Go to Sabnzbd to fix it."
|
||||
DetailedDescription = "You must disable Sabnzbd Date Sorting for the category Readarr uses to prevent import issues. Go to Sabnzbd to fix it."
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
|
||||
[FieldDefinition(5, Label = "Password", Type = FieldType.Password)]
|
||||
public string Password { get; set; }
|
||||
|
||||
[FieldDefinition(6, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional")]
|
||||
[FieldDefinition(6, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Readarr avoids conflicts with unrelated downloads, but it's optional")]
|
||||
public string MusicCategory { get; set; }
|
||||
|
||||
[FieldDefinition(7, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(SabnzbdPriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")]
|
||||
|
||||
@@ -256,7 +256,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission
|
||||
_logger.Error(ex, "Unable to authenticate");
|
||||
return new NzbDroneValidationFailure("Username", "Authentication failure")
|
||||
{
|
||||
DetailedDescription = string.Format("Please verify your username and password. Also verify if the host running Lidarr isn't blocked from accessing {0} by WhiteList limitations in the {0} configuration.", Name)
|
||||
DetailedDescription = string.Format("Please verify your username and password. Also verify if the host running Readarr isn't blocked from accessing {0} by WhiteList limitations in the {0} configuration.", Name)
|
||||
};
|
||||
}
|
||||
catch (DownloadClientUnavailableException ex)
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission
|
||||
[FieldDefinition(4, Label = "Password", Type = FieldType.Password)]
|
||||
public string Password { get; set; }
|
||||
|
||||
[FieldDefinition(5, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional. Creates a [category] subdirectory in the output directory.")]
|
||||
[FieldDefinition(5, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Readarr avoids conflicts with unrelated downloads, but it's optional. Creates a [category] subdirectory in the output directory.")]
|
||||
public string MusicCategory { get; set; }
|
||||
|
||||
[FieldDefinition(6, Label = "Directory", Type = FieldType.Textbox, Advanced = true, HelpText = "Optional location to put downloads in, leave blank to use the default Transmission location")]
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace NzbDrone.Core.Download.Clients.RTorrent
|
||||
|
||||
public override string Name => "rTorrent";
|
||||
|
||||
public override ProviderMessage Message => new ProviderMessage("Lidarr is unable to remove torrents that have finished seeding when using rTorrent", ProviderMessageType.Warning);
|
||||
public override ProviderMessage Message => new ProviderMessage("Readarr is unable to remove torrents that have finished seeding when using rTorrent", ProviderMessageType.Warning);
|
||||
|
||||
public override IEnumerable<DownloadClientItem> GetItems()
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace NzbDrone.Core.Download.Clients.RTorrent
|
||||
Host = "localhost";
|
||||
Port = 8080;
|
||||
UrlBase = "RPC2";
|
||||
MusicCategory = "lidarr";
|
||||
MusicCategory = "readarr";
|
||||
OlderTvPriority = (int)RTorrentPriority.Normal;
|
||||
RecentTvPriority = (int)RTorrentPriority.Normal;
|
||||
}
|
||||
@@ -49,10 +49,10 @@ namespace NzbDrone.Core.Download.Clients.RTorrent
|
||||
[FieldDefinition(5, Label = "Password", Type = FieldType.Password)]
|
||||
public string Password { get; set; }
|
||||
|
||||
[FieldDefinition(6, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional.")]
|
||||
[FieldDefinition(6, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Readarr avoids conflicts with unrelated downloads, but it's optional.")]
|
||||
public string MusicCategory { get; set; }
|
||||
|
||||
[FieldDefinition(7, Label = "Post-Import Category", Type = FieldType.Textbox, Advanced = true, HelpText = "Category for Lidarr to set after it has imported the download. Leave blank to disable this feature.")]
|
||||
[FieldDefinition(7, Label = "Post-Import Category", Type = FieldType.Textbox, Advanced = true, HelpText = "Category for Readarr to set after it has imported the download. Leave blank to disable this feature.")]
|
||||
public string MusicImportedCategory { get; set; }
|
||||
|
||||
[FieldDefinition(8, Label = "Directory", Type = FieldType.Textbox, Advanced = true, HelpText = "Optional location to put downloads in, leave blank to use the default rTorrent location")]
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent
|
||||
{
|
||||
Host = "localhost";
|
||||
Port = 8080;
|
||||
MusicCategory = "lidarr";
|
||||
MusicCategory = "readarr";
|
||||
}
|
||||
|
||||
[FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)]
|
||||
@@ -43,10 +43,10 @@ namespace NzbDrone.Core.Download.Clients.UTorrent
|
||||
[FieldDefinition(4, Label = "Password", Type = FieldType.Password)]
|
||||
public string Password { get; set; }
|
||||
|
||||
[FieldDefinition(5, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional")]
|
||||
[FieldDefinition(5, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Readarr avoids conflicts with unrelated downloads, but it's optional")]
|
||||
public string MusicCategory { get; set; }
|
||||
|
||||
[FieldDefinition(6, Label = "Post-Import Category", Type = FieldType.Textbox, Advanced = true, HelpText = "Category for Lidarr to set after it has imported the download. Leave blank to disable this feature.")]
|
||||
[FieldDefinition(6, Label = "Post-Import Category", Type = FieldType.Textbox, Advanced = true, HelpText = "Category for Readarr to set after it has imported the download. Leave blank to disable this feature.")]
|
||||
public string MusicImportedCategory { get; set; }
|
||||
|
||||
[FieldDefinition(7, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(UTorrentPriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")]
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace NzbDrone.Core.Download
|
||||
|
||||
if (historyItem == null && trackedDownload.DownloadItem.Category.IsNullOrWhiteSpace())
|
||||
{
|
||||
trackedDownload.Warn("Download wasn't grabbed by Lidarr and not in a category, Skipping.");
|
||||
trackedDownload.Warn("Download wasn't grabbed by Readarr and not in a category, Skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace NzbDrone.Core.Download
|
||||
{
|
||||
return new NzbDroneValidationFailure(propertyName, "Folder does not exist")
|
||||
{
|
||||
DetailedDescription = string.Format("The folder you specified does not exist or is inaccessible. Please verify the folder permissions for the user account '{0}', which is used to execute Lidarr.", Environment.UserName)
|
||||
DetailedDescription = string.Format("The folder you specified does not exist or is inaccessible. Please verify the folder permissions for the user account '{0}', which is used to execute Readarr.", Environment.UserName)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace NzbDrone.Core.Download
|
||||
_logger.Error("Folder '{0}' is not writable.", folder);
|
||||
return new NzbDroneValidationFailure(propertyName, "Unable to write to folder")
|
||||
{
|
||||
DetailedDescription = string.Format("The folder you specified is not writable. Please verify the folder permissions for the user account '{0}', which is used to execute Lidarr.", Environment.UserName)
|
||||
DetailedDescription = string.Format("The folder you specified is not writable. Please verify the folder permissions for the user account '{0}', which is used to execute Readarr.", Environment.UserName)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace NzbDrone.Core.Download
|
||||
|
||||
if (grabbedItems.Empty())
|
||||
{
|
||||
trackedDownload.Warn("Download wasn't grabbed by Lidarr, skipping");
|
||||
trackedDownload.Warn("Download wasn't grabbed by Readarr, skipping");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ namespace NzbDrone.Core.Download
|
||||
if (actualHash.IsNotNullOrWhiteSpace() && hash != actualHash)
|
||||
{
|
||||
_logger.Debug(
|
||||
"{0} did not return the expected InfoHash for '{1}', Lidarr could potentially lose track of the download in progress.",
|
||||
"{0} did not return the expected InfoHash for '{1}', Readarr could potentially lose track of the download in progress.",
|
||||
Definition.Implementation,
|
||||
remoteAlbum.Release.DownloadUrl);
|
||||
}
|
||||
@@ -223,7 +223,7 @@ namespace NzbDrone.Core.Download
|
||||
if (actualHash.IsNotNullOrWhiteSpace() && hash != actualHash)
|
||||
{
|
||||
_logger.Debug(
|
||||
"{0} did not return the expected InfoHash for '{1}', Lidarr could potentially lose track of the download in progress.",
|
||||
"{0} did not return the expected InfoHash for '{1}', Readarr could potentially lose track of the download in progress.",
|
||||
Definition.Implementation,
|
||||
remoteAlbum.Release.DownloadUrl);
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads
|
||||
existingItem.CanBeRemoved != downloadItem.CanBeRemoved ||
|
||||
existingItem.CanMoveFiles != downloadItem.CanMoveFiles)
|
||||
{
|
||||
_logger.Debug("Tracking '{0}:{1}': ClientState={2}{3} LidarrStage={4} Album='{5}' OutputPath={6}.",
|
||||
_logger.Debug("Tracking '{0}:{1}': ClientState={2}{3} ReadarrStage={4} Album='{5}' OutputPath={6}.",
|
||||
downloadItem.DownloadClient,
|
||||
downloadItem.Title,
|
||||
downloadItem.Status,
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace NzbDrone.Core.HealthCheck.Checks
|
||||
|
||||
if (enabled.Empty())
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, "No indexers available with RSS sync enabled, Lidarr will not grab new releases automatically");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, "No indexers available with RSS sync enabled, Readarr will not grab new releases automatically");
|
||||
}
|
||||
|
||||
var active = _indexerFactory.RssEnabled(true);
|
||||
|
||||
@@ -23,14 +23,14 @@ namespace NzbDrone.Core.HealthCheck.Checks
|
||||
|
||||
if (automaticSearchEnabled.Empty())
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, "No indexers available with Automatic Search enabled, Lidarr will not provide any automatic search results");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, "No indexers available with Automatic Search enabled, Readarr will not provide any automatic search results");
|
||||
}
|
||||
|
||||
var interactiveSearchEnabled = _indexerFactory.InteractiveSearchEnabled(false);
|
||||
|
||||
if (interactiveSearchEnabled.Empty())
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, "No indexers available with Interactive Search enabled, Lidarr will not provide any interactive search results");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, "No indexers available with Interactive Search enabled, Readarr will not provide any interactive search results");
|
||||
}
|
||||
|
||||
var active = _indexerFactory.AutomaticSearchEnabled(true);
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace NzbDrone.Core.HealthCheck.Checks
|
||||
.WriteSentryDebug("LegacyTlsProvider", monoVersion.ToString())
|
||||
.Write();
|
||||
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, "Lidarr Mono 4.x tls workaround still enabled, consider removing MONO_TLS_PROVIDER=legacy environment option");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, "Readarr Mono 4.x tls workaround still enabled, consider removing MONO_TLS_PROVIDER=legacy environment option");
|
||||
}
|
||||
|
||||
return new HealthCheck(GetType());
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace NzbDrone.Core.HealthCheck.Checks
|
||||
|
||||
private readonly IHttpRequestBuilderFactory _cloudRequestBuilder;
|
||||
|
||||
public ProxyCheck(ILidarrCloudRequestBuilder cloudRequestBuilder, IConfigService configService, IHttpClient client, Logger logger)
|
||||
public ProxyCheck(IReadarrCloudRequestBuilder cloudRequestBuilder, IConfigService configService, IHttpClient client, Logger logger)
|
||||
{
|
||||
_configService = configService;
|
||||
_client = client;
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace NzbDrone.Core.HealthCheck.Checks
|
||||
}
|
||||
else
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Download client {client.Definition.Name} places downloads in {folder.FullPath} but Lidarr cannot see this directory. You may need to adjust the folder's permissions.", "#permissions-error");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Download client {client.Definition.Name} places downloads in {folder.FullPath} but Readarr cannot see this directory. You may need to adjust the folder's permissions.", "#permissions-error");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,7 @@ namespace NzbDrone.Core.HealthCheck.Checks
|
||||
var trackPath = failureMessage.TrackInfo.Path;
|
||||
if (_diskProvider.FileExists(trackPath))
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Lidarr can see but not access downloaded track {trackPath}. Likely permissions error.", "#permissions-error");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Readarr can see but not access downloaded track {trackPath}. Likely permissions error.", "#permissions-error");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -133,7 +133,7 @@ namespace NzbDrone.Core.HealthCheck.Checks
|
||||
// that the user realises something is wrong.
|
||||
if (dlpath.IsNullOrWhiteSpace())
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Lidarr failed to import a track. Check your logs for details.");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Readarr failed to import a track. Check your logs for details.");
|
||||
}
|
||||
|
||||
if (!dlpath.IsPathValid())
|
||||
@@ -154,7 +154,7 @@ namespace NzbDrone.Core.HealthCheck.Checks
|
||||
|
||||
if (_diskProvider.FolderExists(dlpath))
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Lidarr can see but not access download directory {dlpath}. Likely permissions error.", "#permissions-error");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Readarr can see but not access download directory {dlpath}. Likely permissions error.", "#permissions-error");
|
||||
}
|
||||
|
||||
// if it's a remote client/docker, likely missing path mappings
|
||||
@@ -169,7 +169,7 @@ namespace NzbDrone.Core.HealthCheck.Checks
|
||||
else
|
||||
{
|
||||
// path mappings shouldn't be needed locally so probably a permissions issue
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Download client {client.Definition.Name} reported files in {dlpath} but Lidarr cannot see this directory. You may need to adjust the folder's permissions.", "#permissions-error");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Download client {client.Definition.Name} reported files in {dlpath} but Readarr cannot see this directory. You may need to adjust the folder's permissions.", "#permissions-error");
|
||||
}
|
||||
}
|
||||
catch (DownloadClientException ex)
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace NzbDrone.Core.HealthCheck
|
||||
|
||||
private static HttpUri MakeWikiUrl(string fragment)
|
||||
{
|
||||
return new HttpUri("https://github.com/Lidarr/Lidarr/wiki/Health-checks") + new HttpUri(fragment);
|
||||
return new HttpUri("https://github.com/Readarr/Readarr/wiki/Health-checks") + new HttpUri(fragment);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace NzbDrone.Core.ImportLists
|
||||
|
||||
private void MapAlbumReport(ImportListItemInfo report)
|
||||
{
|
||||
var albumQuery = report.AlbumMusicBrainzId.IsNotNullOrWhiteSpace() ? $"lidarr:{report.AlbumMusicBrainzId}" : report.Album;
|
||||
var albumQuery = report.AlbumMusicBrainzId.IsNotNullOrWhiteSpace() ? $"readarr:{report.AlbumMusicBrainzId}" : report.Album;
|
||||
var mappedAlbum = _albumSearchService.SearchForNewAlbum(albumQuery, report.Artist)
|
||||
.FirstOrDefault();
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using NzbDrone.Core.MetadataSource;
|
||||
using NzbDrone.Core.Parser;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
|
||||
namespace NzbDrone.Core.ImportLists.LidarrLists
|
||||
namespace NzbDrone.Core.ImportLists.ReadarrLists
|
||||
{
|
||||
public class LidarrLists : HttpImportListBase<LidarrListsSettings>
|
||||
public class ReadarrLists : HttpImportListBase<ReadarrListsSettings>
|
||||
{
|
||||
public override string Name => "Lidarr Lists";
|
||||
public override string Name => "Readarr Lists";
|
||||
|
||||
public override ImportListType ListType => ImportListType.Other;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace NzbDrone.Core.ImportLists.LidarrLists
|
||||
|
||||
private readonly IMetadataRequestBuilder _requestBuilder;
|
||||
|
||||
public LidarrLists(IHttpClient httpClient, IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, IMetadataRequestBuilder requestBuilder, Logger logger)
|
||||
public ReadarrLists(IHttpClient httpClient, IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, IMetadataRequestBuilder requestBuilder, Logger logger)
|
||||
: base(httpClient, importListStatusService, configService, parsingService, logger)
|
||||
{
|
||||
_requestBuilder = requestBuilder;
|
||||
@@ -38,7 +38,7 @@ namespace NzbDrone.Core.ImportLists.LidarrLists
|
||||
}
|
||||
}
|
||||
|
||||
private ImportListDefinition GetDefinition(string name, LidarrListsSettings settings)
|
||||
private ImportListDefinition GetDefinition(string name, ReadarrListsSettings settings)
|
||||
{
|
||||
return new ImportListDefinition
|
||||
{
|
||||
@@ -49,21 +49,21 @@ namespace NzbDrone.Core.ImportLists.LidarrLists
|
||||
};
|
||||
}
|
||||
|
||||
private LidarrListsSettings GetSettings(string url)
|
||||
private ReadarrListsSettings GetSettings(string url)
|
||||
{
|
||||
var settings = new LidarrListsSettings { ListId = url };
|
||||
var settings = new ReadarrListsSettings { ListId = url };
|
||||
|
||||
return settings;
|
||||
}
|
||||
|
||||
public override IImportListRequestGenerator GetRequestGenerator()
|
||||
{
|
||||
return new LidarrListsRequestGenerator(_requestBuilder) { Settings = Settings };
|
||||
return new ReadarrListsRequestGenerator(_requestBuilder) { Settings = Settings };
|
||||
}
|
||||
|
||||
public override IParseImportListResponse GetParser()
|
||||
{
|
||||
return new LidarrListsParser(Settings);
|
||||
return new ReadarrListsParser(Settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
|
||||
namespace NzbDrone.Core.ImportLists.LidarrLists
|
||||
namespace NzbDrone.Core.ImportLists.ReadarrLists
|
||||
{
|
||||
public class LidarrListsAlbum
|
||||
public class ReadarrListsAlbum
|
||||
{
|
||||
public string ArtistName { get; set; }
|
||||
public string AlbumTitle { get; set; }
|
||||
@@ -5,14 +5,14 @@ using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.ImportLists.Exceptions;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
|
||||
namespace NzbDrone.Core.ImportLists.LidarrLists
|
||||
namespace NzbDrone.Core.ImportLists.ReadarrLists
|
||||
{
|
||||
public class LidarrListsParser : IParseImportListResponse
|
||||
public class ReadarrListsParser : IParseImportListResponse
|
||||
{
|
||||
private readonly LidarrListsSettings _settings;
|
||||
private readonly ReadarrListsSettings _settings;
|
||||
private ImportListResponse _importListResponse;
|
||||
|
||||
public LidarrListsParser(LidarrListsSettings settings)
|
||||
public ReadarrListsParser(ReadarrListsSettings settings)
|
||||
{
|
||||
_settings = settings;
|
||||
}
|
||||
@@ -28,7 +28,7 @@ namespace NzbDrone.Core.ImportLists.LidarrLists
|
||||
return items;
|
||||
}
|
||||
|
||||
var jsonResponse = JsonConvert.DeserializeObject<List<LidarrListsAlbum>>(_importListResponse.Content);
|
||||
var jsonResponse = JsonConvert.DeserializeObject<List<ReadarrListsAlbum>>(_importListResponse.Content);
|
||||
|
||||
// no albums were return
|
||||
if (jsonResponse == null)
|
||||
@@ -1,15 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
using NzbDrone.Core.MetadataSource;
|
||||
|
||||
namespace NzbDrone.Core.ImportLists.LidarrLists
|
||||
namespace NzbDrone.Core.ImportLists.ReadarrLists
|
||||
{
|
||||
public class LidarrListsRequestGenerator : IImportListRequestGenerator
|
||||
public class ReadarrListsRequestGenerator : IImportListRequestGenerator
|
||||
{
|
||||
public LidarrListsSettings Settings { get; set; }
|
||||
public ReadarrListsSettings Settings { get; set; }
|
||||
|
||||
private readonly IMetadataRequestBuilder _requestBulder;
|
||||
|
||||
public LidarrListsRequestGenerator(IMetadataRequestBuilder requestBuilder)
|
||||
public ReadarrListsRequestGenerator(IMetadataRequestBuilder requestBuilder)
|
||||
{
|
||||
_requestBulder = requestBuilder;
|
||||
}
|
||||
@@ -2,20 +2,20 @@ using FluentValidation;
|
||||
using NzbDrone.Core.Annotations;
|
||||
using NzbDrone.Core.Validation;
|
||||
|
||||
namespace NzbDrone.Core.ImportLists.LidarrLists
|
||||
namespace NzbDrone.Core.ImportLists.ReadarrLists
|
||||
{
|
||||
public class LidarrListsSettingsValidator : AbstractValidator<LidarrListsSettings>
|
||||
public class ReadarrListsSettingsValidator : AbstractValidator<ReadarrListsSettings>
|
||||
{
|
||||
public LidarrListsSettingsValidator()
|
||||
public ReadarrListsSettingsValidator()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public class LidarrListsSettings : IImportListSettings
|
||||
public class ReadarrListsSettings : IImportListSettings
|
||||
{
|
||||
private static readonly LidarrListsSettingsValidator Validator = new LidarrListsSettingsValidator();
|
||||
private static readonly ReadarrListsSettingsValidator Validator = new ReadarrListsSettingsValidator();
|
||||
|
||||
public LidarrListsSettings()
|
||||
public ReadarrListsSettings()
|
||||
{
|
||||
BaseUrl = "";
|
||||
}
|
||||
@@ -240,7 +240,7 @@ namespace NzbDrone.Core.ImportLists.Spotify
|
||||
}
|
||||
catch (HttpException e)
|
||||
{
|
||||
_logger.Warn(e, "Unable to communicate with LidarrAPI");
|
||||
_logger.Warn(e, "Unable to communicate with ReadarrAPI");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -283,7 +283,7 @@ namespace NzbDrone.Core.ImportLists.Spotify
|
||||
}
|
||||
catch (HttpException e)
|
||||
{
|
||||
_logger.Warn(e, "Unable to communicate with LidarrAPI");
|
||||
_logger.Warn(e, "Unable to communicate with ReadarrAPI");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -30,8 +30,8 @@ namespace NzbDrone.Core.ImportLists.Spotify
|
||||
public string BaseUrl { get; set; }
|
||||
|
||||
public string OAuthUrl => "https://accounts.spotify.com/authorize";
|
||||
public string RedirectUri => "https://spotify.lidarr.audio/auth";
|
||||
public string RenewUri => "https://spotify.lidarr.audio/renew";
|
||||
public string RedirectUri => "https://spotify.readarr.audio/auth";
|
||||
public string RenewUri => "https://spotify.readarr.audio/renew";
|
||||
public string ClientId => "848082790c32436d8a0405fddca0aa18";
|
||||
public virtual string Scope => "";
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace NzbDrone.Core.Indexers.Gazelle
|
||||
[FieldDefinition(4)]
|
||||
public SeedCriteriaSettings SeedCriteria { get; set; } = new SeedCriteriaSettings();
|
||||
|
||||
[FieldDefinition(5, Type = FieldType.Number, Label = "Early Download Limit", Unit = "days", HelpText = "Time before release date Lidarr will download from this indexer, empty is no limit", Advanced = true)]
|
||||
[FieldDefinition(5, Type = FieldType.Number, Label = "Early Download Limit", Unit = "days", HelpText = "Time before release date Readarr will download from this indexer, empty is no limit", Advanced = true)]
|
||||
public int? EarlyReleaseLimit { get; set; }
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace NzbDrone.Core.Indexers.Headphones
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex, "Failed to determine headphones api capabilities for {0}, using the defaults instead till Lidarr restarts", indexerSettings.BaseUrl);
|
||||
_logger.Error(ex, "Failed to determine headphones api capabilities for {0}, using the defaults instead till Readarr restarts", indexerSettings.BaseUrl);
|
||||
}
|
||||
|
||||
return capabilities;
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace NzbDrone.Core.Indexers.Headphones
|
||||
[FieldDefinition(2, Label = "Password", Type = FieldType.Password)]
|
||||
public string Password { get; set; }
|
||||
|
||||
[FieldDefinition(3, Type = FieldType.Number, Label = "Early Download Limit", Unit = "days", HelpText = "Time before release date Lidarr will download from this indexer, empty is no limit", Advanced = true)]
|
||||
[FieldDefinition(3, Type = FieldType.Number, Label = "Early Download Limit", Unit = "days", HelpText = "Time before release date Readarr will download from this indexer, empty is no limit", Advanced = true)]
|
||||
public int? EarlyReleaseLimit { get; set; }
|
||||
|
||||
public virtual NzbDroneValidationResult Validate()
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace NzbDrone.Core.Indexers.IPTorrents
|
||||
[FieldDefinition(2)]
|
||||
public SeedCriteriaSettings SeedCriteria { get; set; } = new SeedCriteriaSettings();
|
||||
|
||||
[FieldDefinition(3, Type = FieldType.Number, Label = "Early Download Limit", Unit = "days", HelpText = "Time before release date Lidarr will download from this indexer, empty is no limit", Advanced = true)]
|
||||
[FieldDefinition(3, Type = FieldType.Number, Label = "Early Download Limit", Unit = "days", HelpText = "Time before release date Readarr will download from this indexer, empty is no limit", Advanced = true)]
|
||||
public int? EarlyReleaseLimit { get; set; }
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace NzbDrone.Core.Indexers.Newznab
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex, "Failed to determine newznab api capabilities for {0}, using the defaults instead till Lidarr restarts", indexerSettings.BaseUrl);
|
||||
_logger.Error(ex, "Failed to determine newznab api capabilities for {0}, using the defaults instead till Readarr restarts", indexerSettings.BaseUrl);
|
||||
}
|
||||
|
||||
return capabilities;
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace NzbDrone.Core.Indexers.Newznab
|
||||
[FieldDefinition(3, Label = "Categories", HelpText = "Comma Separated list, leave blank to disable standard/daily shows", Advanced = true)]
|
||||
public IEnumerable<int> Categories { get; set; }
|
||||
|
||||
[FieldDefinition(4, Type = FieldType.Number, Label = "Early Download Limit", HelpText = "Time before release date Lidarr will download from this indexer, empty is no limit", Unit = "days", Advanced = true)]
|
||||
[FieldDefinition(4, Type = FieldType.Number, Label = "Early Download Limit", HelpText = "Time before release date Readarr will download from this indexer, empty is no limit", Unit = "days", Advanced = true)]
|
||||
public int? EarlyReleaseLimit { get; set; }
|
||||
|
||||
[FieldDefinition(5, Label = "Additional Parameters", HelpText = "Additional Newznab parameters", Advanced = true)]
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace NzbDrone.Core.Indexers.Nyaa
|
||||
[FieldDefinition(3)]
|
||||
public SeedCriteriaSettings SeedCriteria { get; set; } = new SeedCriteriaSettings();
|
||||
|
||||
[FieldDefinition(4, Type = FieldType.Number, Label = "Early Download Limit", Unit = "days", HelpText = "Time before release date Lidarr will download from this indexer, empty is no limit", Advanced = true)]
|
||||
[FieldDefinition(4, Type = FieldType.Number, Label = "Early Download Limit", Unit = "days", HelpText = "Time before release date Readarr will download from this indexer, empty is no limit", Advanced = true)]
|
||||
public int? EarlyReleaseLimit { get; set; }
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace NzbDrone.Core.Indexers.Omgwtfnzbs
|
||||
[FieldDefinition(2, Label = "Delay", HelpText = "Time in minutes to delay new nzbs before they appear on the RSS feed", Advanced = true)]
|
||||
public int Delay { get; set; }
|
||||
|
||||
[FieldDefinition(3, Type = FieldType.Number, Label = "Early Download Limit", Unit = "days", HelpText = "Time before release date Lidarr will download from this indexer, empty is no limit", Advanced = true)]
|
||||
[FieldDefinition(3, Type = FieldType.Number, Label = "Early Download Limit", Unit = "days", HelpText = "Time before release date Readarr will download from this indexer, empty is no limit", Advanced = true)]
|
||||
public int? EarlyReleaseLimit { get; set; }
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace NzbDrone.Core.Indexers.Rarbg
|
||||
torrentInfo.Title = torrent.title;
|
||||
torrentInfo.Size = torrent.size;
|
||||
torrentInfo.DownloadUrl = torrent.download;
|
||||
torrentInfo.InfoUrl = torrent.info_page + "&app_id=Lidarr";
|
||||
torrentInfo.InfoUrl = torrent.info_page + "&app_id=Readarr";
|
||||
torrentInfo.PublishDate = torrent.pubdate.ToUniversalTime();
|
||||
torrentInfo.Seeders = torrent.seeders;
|
||||
torrentInfo.Peers = torrent.leechers + torrent.seeders;
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace NzbDrone.Core.Indexers.Rarbg
|
||||
[FieldDefinition(4)]
|
||||
public SeedCriteriaSettings SeedCriteria { get; set; } = new SeedCriteriaSettings();
|
||||
|
||||
[FieldDefinition(5, Type = FieldType.Number, Label = "Early Download Limit", HelpText = "Time before release date Lidarr will download from this indexer, empty is no limit", Advanced = true)]
|
||||
[FieldDefinition(5, Type = FieldType.Number, Label = "Early Download Limit", HelpText = "Time before release date Readarr will download from this indexer, empty is no limit", Advanced = true)]
|
||||
public int? EarlyReleaseLimit { get; set; }
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace NzbDrone.Core.Indexers.Rarbg
|
||||
{
|
||||
var requestBuilder = new HttpRequestBuilder(settings.BaseUrl.Trim('/'))
|
||||
.WithRateLimit(3.0)
|
||||
.Resource("/pubapi_v2.php?get_token=get_token&app_id=Lidarr")
|
||||
.Resource("/pubapi_v2.php?get_token=get_token&app_id=Readarr")
|
||||
.Accept(HttpAccept.Json);
|
||||
|
||||
if (settings.CaptchaToken.IsNotNullOrWhiteSpace())
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace NzbDrone.Core.Indexers.TorrentRss
|
||||
[FieldDefinition(4)]
|
||||
public SeedCriteriaSettings SeedCriteria { get; set; } = new SeedCriteriaSettings();
|
||||
|
||||
[FieldDefinition(5, Type = FieldType.Number, Label = "Early Download Limit", Unit = "days", HelpText = "Time before release date Lidarr will download from this indexer, empty is no limit", Advanced = true)]
|
||||
[FieldDefinition(5, Type = FieldType.Number, Label = "Early Download Limit", Unit = "days", HelpText = "Time before release date Readarr will download from this indexer, empty is no limit", Advanced = true)]
|
||||
public int? EarlyReleaseLimit { get; set; }
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace NzbDrone.Core.Indexers.Torrentleech
|
||||
[FieldDefinition(3)]
|
||||
public SeedCriteriaSettings SeedCriteria { get; set; } = new SeedCriteriaSettings();
|
||||
|
||||
[FieldDefinition(4, Type = FieldType.Number, Label = "Early Download Limit", Unit = "days", HelpText = "Time before release date Lidarr will download from this indexer, empty is no limit", Advanced = true)]
|
||||
[FieldDefinition(4, Type = FieldType.Number, Label = "Early Download Limit", Unit = "days", HelpText = "Time before release date Readarr will download from this indexer, empty is no limit", Advanced = true)]
|
||||
public int? EarlyReleaseLimit { get; set; }
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace NzbDrone.Core.Indexers.Waffles
|
||||
[FieldDefinition(4)]
|
||||
public SeedCriteriaSettings SeedCriteria { get; set; } = new SeedCriteriaSettings();
|
||||
|
||||
[FieldDefinition(5, Type = FieldType.Number, Label = "Early Download Limit", Unit = "days", HelpText = "Time before release date Lidarr will download from this indexer, empty is no limit", Advanced = true)]
|
||||
[FieldDefinition(5, Type = FieldType.Number, Label = "Early Download Limit", Unit = "days", HelpText = "Time before release date Readarr will download from this indexer, empty is no limit", Advanced = true)]
|
||||
public int? EarlyReleaseLimit { get; set; }
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user