mirror of
https://github.com/Radarr/Radarr.git
synced 2026-03-15 15:54:47 -04:00
Compare commits
17 Commits
sonarr-pul
...
v4.3.0.667
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
500bc3a571 | ||
|
|
e6567d0365 | ||
|
|
dbca393772 | ||
|
|
9662495fa2 | ||
|
|
76f0c54b3c | ||
|
|
d7ff92115c | ||
|
|
54a49d6878 | ||
|
|
a8362511f9 | ||
|
|
b9f2b3e06f | ||
|
|
d995bc5a7e | ||
|
|
8886162bba | ||
|
|
eb9eb4ec64 | ||
|
|
f910a8fde7 | ||
|
|
f6904608a7 | ||
|
|
0c79548fc4 | ||
|
|
362e664ce6 | ||
|
|
c2cbfb274a |
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1,6 +1,6 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
github: radarr
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: radarr
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
|
||||
10
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
10
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -45,11 +45,11 @@ body:
|
||||
- **Database**: Sqlite 3.36.0
|
||||
value: |
|
||||
- OS:
|
||||
- Radarr:
|
||||
- Docker Install:
|
||||
- Using Reverse Proxy:
|
||||
- Browser:
|
||||
- Database:
|
||||
- Radarr:
|
||||
- Docker Install:
|
||||
- Using Reverse Proxy:
|
||||
- Browser:
|
||||
- Database:
|
||||
render: markdown
|
||||
validations:
|
||||
required: true
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
4
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -5,9 +5,9 @@ body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Is there an existing issue for this?
|
||||
description: Please search to see if an issue already exists for the feature you are requesting.
|
||||
description: Please search to see if an open or closed issue already exists for the feature you are requesting. If a request exists and is closed note that it may only be fixed in an unstable branch.
|
||||
options:
|
||||
- label: I have searched the existing issues
|
||||
- label: I have searched the existing open and closed issues
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
|
||||
4
.github/workflows/azuresync.yml
vendored
4
.github/workflows/azuresync.yml
vendored
@@ -7,8 +7,12 @@ on:
|
||||
|
||||
concurrency: azuresync-${{ github.event.issue.number }}
|
||||
|
||||
permissions: {}
|
||||
jobs:
|
||||
alert:
|
||||
permissions:
|
||||
issues: write # to update issue body
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: danhellem/github-actions-issue-to-work-item@master
|
||||
|
||||
5
.github/workflows/lock.yml
vendored
5
.github/workflows/lock.yml
vendored
@@ -5,8 +5,13 @@ on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
permissions: {}
|
||||
jobs:
|
||||
lock:
|
||||
permissions:
|
||||
issues: write # to lock issues (dessant/lock-threads)
|
||||
pull-requests: write # to lock PRs (dessant/lock-threads)
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/lock-threads@v2
|
||||
|
||||
4
.github/workflows/support.yml
vendored
4
.github/workflows/support.yml
vendored
@@ -4,8 +4,12 @@ on:
|
||||
issues:
|
||||
types: [labeled, unlabeled, reopened]
|
||||
|
||||
permissions: {}
|
||||
jobs:
|
||||
support:
|
||||
permissions:
|
||||
issues: write # to modify issues
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/support-requests@v2
|
||||
|
||||
@@ -9,7 +9,7 @@ variables:
|
||||
testsFolder: './_tests'
|
||||
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
|
||||
nugetCacheFolder: $(Pipeline.Workspace)/.nuget/packages
|
||||
majorVersion: '4.2.4'
|
||||
majorVersion: '4.3.0'
|
||||
minorVersion: $[counter('minorVersion', 2000)]
|
||||
radarrVersion: '$(majorVersion).$(minorVersion)'
|
||||
buildName: '$(Build.SourceBranchName).$(radarrVersion)'
|
||||
|
||||
@@ -105,6 +105,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
||||
[TestCase("Movie Title (2009) (2160p PMTP WEB-DL Hybrid H265 DV HDR10+ DDP Atmos 5.1 English - HONE)", "HONE")]
|
||||
[TestCase("Why.Cant.You.Use.Normal.Characters.2021.2160p.UHD.HDR10+.BluRay.TrueHD.Atmos.7.1.x265-ZØNEHD", "ZØNEHD")]
|
||||
[TestCase("Movie.Should.Not.Use.Dots.2022.1080p.BluRay.x265.10bit.Tigole", "Tigole")]
|
||||
[TestCase("Movie.Title.2005.2160p.UHD.BluRay.TrueHD 7.1.Atmos.x265 - HQMUX", "HQMUX")]
|
||||
public void should_parse_exception_release_group(string title, string expected)
|
||||
{
|
||||
Parser.Parser.ParseReleaseGroup(title).Should().Be(expected);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Data.Common;
|
||||
using System.Data.SQLite;
|
||||
using System.Net.Sockets;
|
||||
using NLog;
|
||||
using Npgsql;
|
||||
using NzbDrone.Common.Disk;
|
||||
@@ -124,6 +125,37 @@ namespace NzbDrone.Core.Datastore
|
||||
|
||||
throw new CorruptDatabaseException("Database file: {0} is corrupt, restore from backup if available. See: https://wiki.servarr.com/radarr/faq#i-am-getting-an-error-database-disk-image-is-malformed", e, fileName);
|
||||
}
|
||||
catch (NpgsqlException e)
|
||||
{
|
||||
if (e.InnerException is SocketException)
|
||||
{
|
||||
var retryCount = 3;
|
||||
|
||||
while (true)
|
||||
{
|
||||
Logger.Error(e, "Failure to connect to Postgres DB, {0} retries remaining", retryCount);
|
||||
|
||||
try
|
||||
{
|
||||
_migrationController.Migrate(connectionString, migrationContext);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (--retryCount > 0)
|
||||
{
|
||||
System.Threading.Thread.Sleep(5000);
|
||||
continue;
|
||||
}
|
||||
|
||||
throw new RadarrStartupException(ex, "Error creating main database");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new RadarrStartupException(e, "Error creating main database");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new RadarrStartupException(e, "Error creating main database");
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.Messaging.Events;
|
||||
|
||||
@@ -7,6 +8,7 @@ namespace NzbDrone.Core.ImportLists.ImportListMovies
|
||||
public interface IImportListMovieRepository : IBasicRepository<ImportListMovie>
|
||||
{
|
||||
List<ImportListMovie> GetAllForLists(List<int> listIds);
|
||||
bool ExistsByMetadataId(int metadataId);
|
||||
}
|
||||
|
||||
public class ImportListMovieRepository : BasicRepository<ImportListMovie>, IImportListMovieRepository
|
||||
@@ -20,5 +22,12 @@ namespace NzbDrone.Core.ImportLists.ImportListMovies
|
||||
{
|
||||
return Query(x => listIds.Contains(x.ListId));
|
||||
}
|
||||
|
||||
public bool ExistsByMetadataId(int metadataId)
|
||||
{
|
||||
var movies = Query(x => x.MovieMetadataId == metadataId);
|
||||
|
||||
return movies.Any();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace NzbDrone.Core.ImportLists.ImportListMovies
|
||||
List<ImportListMovie> SyncMoviesForList(List<ImportListMovie> listMovies, int listId);
|
||||
void RemoveListMovie(ImportListMovie listMovie);
|
||||
ImportListMovie GetById(int id);
|
||||
bool ExistsByMetadataId(int metadataId);
|
||||
}
|
||||
|
||||
public class ImportListMovieService : IImportListMovieService, IHandleAsync<ProviderDeletedEvent<IImportList>>
|
||||
@@ -79,5 +80,10 @@ namespace NzbDrone.Core.ImportLists.ImportListMovies
|
||||
var moviesOnList = _importListMovieRepository.GetAllForLists(new List<int> { message.ProviderId });
|
||||
_importListMovieRepository.DeleteMany(moviesOnList);
|
||||
}
|
||||
|
||||
public bool ExistsByMetadataId(int metadataId)
|
||||
{
|
||||
return _importListMovieRepository.ExistsByMetadataId(metadataId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
"NoListRecommendations": "No s'han trobat elements de llista ni recomanacions; per començar, podeu afegir una pel·lícula nova, importar-ne algunes existents o afegir una llista.",
|
||||
"NotAvailable": "No disponible",
|
||||
"PreferAndUpgrade": "Marca preferit i actualitza",
|
||||
"QualityProfileInUse": "No es pot suprimir un perfil de qualitat usat a una pel·lícula",
|
||||
"QualityProfileInUse": "No es pot suprimir un perfil de qualitat usat a una pel·lícula, llista o col·lecció",
|
||||
"RadarrTags": "Etiquetes de Radarr",
|
||||
"Reddit": "Reddit",
|
||||
"RSSSyncInterval": "Interval de sincronització RSS",
|
||||
@@ -594,7 +594,7 @@
|
||||
"IndexersSettingsSummary": "Indexadors i restriccions de llançament",
|
||||
"IndexerStatusCheckAllClientMessage": "Tots els indexadors no estan disponibles a causa d'errors",
|
||||
"IndexerStatusCheckSingleClientMessage": "Els indexadors no estan disponibles a causa d'errors: {0}",
|
||||
"IndexerTagHelpText": "Utilitzeu aquest indexador només per a pel·lícules amb almenys una etiqueta coincident. Deixa en blanc per utilitzar-lo amb totes les pel·lícules.",
|
||||
"IndexerTagHelpText": "Utilitzeu aquest indexador només per a pel·lícules amb almenys una etiqueta coincident. Deixeu-ho en blanc per utilitzar-ho amb totes les pel·lícules.",
|
||||
"InstallLatest": "Instal·la l'últim",
|
||||
"LanguageHelpText": "Idioma per a llançaments",
|
||||
"Large": "Gran",
|
||||
@@ -804,7 +804,7 @@
|
||||
"RemotePathMappingCheckFilesLocalWrongOSPath": "El client de baixada local {0} ha informat de fitxers a {1}, però el camí {2} no és vàlid. Reviseu la configuració del vostre client de baixada.",
|
||||
"RemotePathMappingCheckFilesWrongOSPath": "El client de baixada remota {0} ha informat de fitxers a {1}, però el camí {2} no és vàlid. Reviseu els mapes de camins remots i baixeu la configuració del client.",
|
||||
"RemotePathMappingCheckFolderPermissions": "Radarr pot veure però no accedir al directori de descàrregues {0}. Error de permisos probable.",
|
||||
"RemotePathMappingCheckGenericPermissions": "El client de baixada {0} col·loca les baixades a {1}, però Radarr no pot veure aquest directori. És possible que hàgiu d'ajustar els permisos de la carpeta.",
|
||||
"RemotePathMappingCheckGenericPermissions": "El client de baixada {0} col·loca les baixades a {1}, però Radarr no pot veure aquest directori. És possible que hàgiu d'ajustar els permisos de la carpeta.",
|
||||
"RemotePathMappingCheckImportFailed": "Radarr no ha pogut importar una pel·lícula. Comproveu els vostres registres per obtenir més informació.",
|
||||
"RemotePathMappingCheckLocalFolderMissing": "El client de descàrrega remota {0} col·loca les baixades a {1}, però sembla que aquest directori no existeix. És probable que falti o sigui incorrecte l'assignació de camins remots.",
|
||||
"RemotePathMappingCheckLocalWrongOSPath": "El client de baixada local {0} col·loca les baixades a {1}, però el camí {2} no és vàlid. Reviseu la configuració del vostre client de baixada.",
|
||||
|
||||
@@ -339,7 +339,7 @@
|
||||
"ChangeHasNotBeenSavedYet": "Änderung wurde noch nicht gespeichert",
|
||||
"CheckForFinishedDownloadsInterval": "Intervall zum prüfen von fertigen Downloads",
|
||||
"CleanLibraryLevel": "Mediathek aufräumen",
|
||||
"ClickToChangeLanguage": "Sprache ändern...",
|
||||
"ClickToChangeLanguage": "Sprache ändern ...",
|
||||
"ClickToChangeQuality": "Hier klicken um die Qualität zu ändern",
|
||||
"ClientPriority": "Priorität",
|
||||
"CloneFormatTag": "Format Tag kopieren",
|
||||
@@ -889,7 +889,7 @@
|
||||
"RadarrUpdated": "Radarr wurde aktualisiert",
|
||||
"RadarrCalendarFeed": "Radarr Kalender Feed",
|
||||
"QueueIsEmpty": "Warteschlange ist leer",
|
||||
"QualityProfileInUse": "Ein Qualitätsprofil mit zugeordneten Filmen kann nicht gelöscht werden",
|
||||
"QualityProfileInUse": "Ein Qualitätsprofil mit zugeordneten Filmen, Listen oder Sammlungen kann nicht gelöscht werden",
|
||||
"QualityOrLangCutoffHasNotBeenMet": "Qualität oder Sprache haben die Schwelle noch nicht erreicht",
|
||||
"QualityLimitsHelpText": "Limitierungen werden automatisch an die Filmlänge angepasst.",
|
||||
"QualitiesHelpText": "Qualitätsprofile oben sind mehr bevorzugt. Profile in einer Gruppe sind gleichgestellt. Nur ausgewählte werden gesucht",
|
||||
|
||||
@@ -1006,7 +1006,7 @@
|
||||
"TorrentDelayTime": "Torrent-vertraging: {0}",
|
||||
"TorrentsDisabled": "Torrents uitgeschakeld",
|
||||
"Trace": "Spoor",
|
||||
"Trailer": "Aanhangwagen",
|
||||
"Trailer": "Trailer",
|
||||
"Trakt": "Trakt",
|
||||
"Trigger": "In gang zetten",
|
||||
"UnableToImportCheckLogs": "Gedownload - Kan niet importeren: controleer de logboeken voor details",
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
"BranchUpdate": "更新Radarr的分支",
|
||||
"Branch": "分支",
|
||||
"Calendar": "日历",
|
||||
"BindAddressHelpText": "192.168.50.189:7878",
|
||||
"BindAddressHelpText": "有效的 IP4 地址或以'*'代表所有地址",
|
||||
"BackupRetentionHelpText": "早于保留周期的自动备份将被自动清除",
|
||||
"BackupNow": "马上备份",
|
||||
"BackupIntervalHelpText": "自动备份时间间隔",
|
||||
@@ -637,7 +637,7 @@
|
||||
"InstallLatest": "安装最新版",
|
||||
"IndexerStatusCheckSingleClientMessage": "搜刮器因错误不可用:{0}",
|
||||
"IndexerStatusCheckAllClientMessage": "所有搜刮器都因错误不可用",
|
||||
"IndexerSearchCheckNoInteractiveMessage": "没有任何索引器开启了手动搜索,因此Radarr 不会提供任何手动搜索的结果",
|
||||
"IndexerSearchCheckNoInteractiveMessage": "没有任何索引器勾选了手动搜索,因此Radarr 不会提供任何手动搜索的结果",
|
||||
"IndexerRssHealthCheckNoIndexers": "没有任何索引器开启了RSS同步,Radarr不会自动抓取新发布的影片",
|
||||
"IndexerLongTermStatusCheckSingleClientMessage": "由于故障6小时,下列索引器都已不可用:{0}",
|
||||
"IndexerLongTermStatusCheckAllClientMessage": "由于故障超过6小时,所有索引器均不可用",
|
||||
@@ -775,7 +775,7 @@
|
||||
"Updates": "更新",
|
||||
"UnableToLoadRestrictions": "无法加载限制条件",
|
||||
"UnmonitoredHelpText": "在iCal订阅中包含未监控的电影",
|
||||
"QualityProfileInUse": "无法删除已指定给影片的质量配置",
|
||||
"QualityProfileInUse": "无法删除已指定给影片、列表、收藏的质量配置",
|
||||
"UnableToLoadQualities": "无法加载影片质量",
|
||||
"UnmappedFolders": "未映射的文件夹",
|
||||
"RecycleBinCleanupDaysHelpTextWarning": "回收站中的文件在超出选择的天数后会被自动清理",
|
||||
@@ -1143,5 +1143,7 @@
|
||||
"ShowPosters": "显示海报",
|
||||
"OnMovieAdded": "电影添加时",
|
||||
"OnMovieAddedHelpText": "电影添加时",
|
||||
"TotalMovies": "电影总数"
|
||||
"TotalMovies": "电影总数",
|
||||
"ApplicationUrlHelpText": "此应用的外部URL包含 http(s)://,端口和基本URL",
|
||||
"ApplicationURL": "程序URL"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Core.CustomFormats;
|
||||
using NzbDrone.Core.DecisionEngine;
|
||||
@@ -11,19 +9,16 @@ namespace NzbDrone.Core.MediaFiles.MovieImport.Specifications
|
||||
{
|
||||
public class UpgradeSpecification : IImportDecisionEngineSpecification
|
||||
{
|
||||
private readonly ICustomFormatCalculationService _customFormatCalculationService;
|
||||
private readonly Logger _logger;
|
||||
|
||||
public UpgradeSpecification(ICustomFormatCalculationService customFormatCalculationService, Logger logger)
|
||||
{
|
||||
_customFormatCalculationService = customFormatCalculationService;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public Decision IsSatisfiedBy(LocalMovie localMovie, DownloadClientItem downloadClientItem)
|
||||
{
|
||||
var qualityComparer = new QualityModelComparer(localMovie.Movie.Profile);
|
||||
var preferredWordScore = GetCustomFormatScore(localMovie);
|
||||
|
||||
if (localMovie.Movie.MovieFileId > 0)
|
||||
{
|
||||
@@ -42,47 +37,9 @@ namespace NzbDrone.Core.MediaFiles.MovieImport.Specifications
|
||||
_logger.Debug("This file isn't a quality upgrade for movie. Skipping {0}", localMovie.Path);
|
||||
return Decision.Reject("Not a quality upgrade for existing movie file(s)");
|
||||
}
|
||||
|
||||
movieFile.Movie = localMovie.Movie;
|
||||
|
||||
var customFormats = _customFormatCalculationService.ParseCustomFormat(movieFile);
|
||||
var movieFileCustomFormatScore = localMovie.Movie.Profile.CalculateCustomFormatScore(customFormats);
|
||||
|
||||
if (qualityCompare == 0 && preferredWordScore < movieFileCustomFormatScore)
|
||||
{
|
||||
_logger.Debug("This file isn't a custom format upgrade for movie. Skipping {0}", localMovie.Path);
|
||||
return Decision.Reject("Not a custom format upgrade for existing movie file(s)");
|
||||
}
|
||||
}
|
||||
|
||||
return Decision.Accept();
|
||||
}
|
||||
|
||||
private int GetCustomFormatScore(LocalMovie localMovie)
|
||||
{
|
||||
var movie = localMovie.Movie;
|
||||
var fileFormats = new List<CustomFormat>();
|
||||
var folderFormats = new List<CustomFormat>();
|
||||
var clientFormats = new List<CustomFormat>();
|
||||
|
||||
if (localMovie.FileMovieInfo != null)
|
||||
{
|
||||
fileFormats = _customFormatCalculationService.ParseCustomFormat(localMovie.FileMovieInfo, movie);
|
||||
}
|
||||
|
||||
if (localMovie.FolderMovieInfo != null)
|
||||
{
|
||||
folderFormats = _customFormatCalculationService.ParseCustomFormat(localMovie.FolderMovieInfo, movie);
|
||||
}
|
||||
|
||||
if (localMovie.DownloadClientMovieInfo != null)
|
||||
{
|
||||
clientFormats = _customFormatCalculationService.ParseCustomFormat(localMovie.DownloadClientMovieInfo, movie);
|
||||
}
|
||||
|
||||
var formats = fileFormats.Union(folderFormats.Union(clientFormats)).ToList();
|
||||
|
||||
return movie.Profile.CalculateCustomFormatScore(formats);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using NzbDrone.Core.ImportLists.ImportListMovies;
|
||||
|
||||
namespace NzbDrone.Core.Movies
|
||||
{
|
||||
@@ -11,15 +12,20 @@ namespace NzbDrone.Core.Movies
|
||||
List<MovieMetadata> GetMoviesByCollectionTmdbId(int collectionId);
|
||||
bool Upsert(MovieMetadata movie);
|
||||
bool UpsertMany(List<MovieMetadata> movies);
|
||||
void DeleteMany(List<MovieMetadata> movies);
|
||||
}
|
||||
|
||||
public class MovieMetadataService : IMovieMetadataService
|
||||
{
|
||||
private readonly IMovieMetadataRepository _movieMetadataRepository;
|
||||
private readonly IMovieService _movieService;
|
||||
private readonly IImportListMovieService _importListMovieService;
|
||||
|
||||
public MovieMetadataService(IMovieMetadataRepository movieMetadataRepository)
|
||||
public MovieMetadataService(IMovieMetadataRepository movieMetadataRepository, IMovieService movieService, IImportListMovieService importListMovieService)
|
||||
{
|
||||
_movieMetadataRepository = movieMetadataRepository;
|
||||
_movieService = movieService;
|
||||
_importListMovieService = importListMovieService;
|
||||
}
|
||||
|
||||
public MovieMetadata FindByTmdbId(int tmdbId)
|
||||
@@ -56,5 +62,16 @@ namespace NzbDrone.Core.Movies
|
||||
{
|
||||
return _movieMetadataRepository.UpsertMany(movies);
|
||||
}
|
||||
|
||||
public void DeleteMany(List<MovieMetadata> movies)
|
||||
{
|
||||
foreach (var movie in movies)
|
||||
{
|
||||
if (!_importListMovieService.ExistsByMetadataId(movie.Id) && !_movieService.ExistsByMetadataId(movie.Id))
|
||||
{
|
||||
_movieMetadataRepository.Delete(movie);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Dapper;
|
||||
using NzbDrone.Core.Datastore;
|
||||
@@ -30,6 +31,7 @@ namespace NzbDrone.Core.Movies
|
||||
List<int> AllMovieTmdbIds();
|
||||
Dictionary<int, List<int>> AllMovieTags();
|
||||
List<int> GetRecommendations();
|
||||
bool ExistsByMetadataId(int metadataId);
|
||||
}
|
||||
|
||||
public class MovieRepository : BasicRepository<Movie>, IMovieRepository
|
||||
@@ -367,5 +369,12 @@ namespace NzbDrone.Core.Movies
|
||||
|
||||
return recommendations;
|
||||
}
|
||||
|
||||
public bool ExistsByMetadataId(int metadataId)
|
||||
{
|
||||
var movies = Query(x => x.MovieMetadataId == metadataId);
|
||||
|
||||
return movies.Any();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ namespace NzbDrone.Core.Movies
|
||||
List<int> GetRecommendedTmdbIds();
|
||||
bool MoviePathExists(string folder);
|
||||
void RemoveAddOptions(Movie movie);
|
||||
bool ExistsByMetadataId(int metadataId);
|
||||
}
|
||||
|
||||
public class MovieService : IMovieService, IHandle<MovieFileAddedEvent>,
|
||||
@@ -389,6 +390,11 @@ namespace NzbDrone.Core.Movies
|
||||
return _movieRepository.GetRecommendations();
|
||||
}
|
||||
|
||||
public bool ExistsByMetadataId(int metadataId)
|
||||
{
|
||||
return _movieRepository.ExistsByMetadataId(metadataId);
|
||||
}
|
||||
|
||||
public void Handle(MovieFileAddedEvent message)
|
||||
{
|
||||
var movie = message.MovieFile.Movie;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Instrumentation.Extensions;
|
||||
@@ -48,6 +49,7 @@ namespace NzbDrone.Core.Movies
|
||||
_logger.ProgressInfo("Updating info for {0}", collection.Title);
|
||||
|
||||
MovieCollection collectionInfo;
|
||||
List<MovieMetadata> movies;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -68,8 +70,27 @@ namespace NzbDrone.Core.Movies
|
||||
collection.LastInfoSync = DateTime.UtcNow;
|
||||
collection.Images = collectionInfo.Images;
|
||||
|
||||
collectionInfo.Movies.ForEach(x => x.CollectionTmdbId = collection.TmdbId);
|
||||
_movieMetadataService.UpsertMany(collectionInfo.Movies);
|
||||
movies = collectionInfo.Movies;
|
||||
movies.ForEach(x => x.CollectionTmdbId = collection.TmdbId);
|
||||
|
||||
var existingMetaForCollection = _movieMetadataService.GetMoviesByCollectionTmdbId(collection.TmdbId);
|
||||
|
||||
var updateList = new List<MovieMetadata>();
|
||||
|
||||
foreach (var remoteMovie in movies)
|
||||
{
|
||||
var existing = existingMetaForCollection.FirstOrDefault(e => e.TmdbId == remoteMovie.TmdbId);
|
||||
|
||||
if (existingMetaForCollection.Any(x => x.TmdbId == remoteMovie.TmdbId))
|
||||
{
|
||||
existingMetaForCollection.Remove(existing);
|
||||
}
|
||||
|
||||
updateList.Add(remoteMovie);
|
||||
}
|
||||
|
||||
_movieMetadataService.UpsertMany(updateList);
|
||||
_movieMetadataService.DeleteMany(existingMetaForCollection);
|
||||
|
||||
_logger.Debug("Finished collection refresh for {0}", collection.Title);
|
||||
|
||||
|
||||
@@ -60,6 +60,8 @@ namespace NzbDrone.Core.Notifications.CustomScript
|
||||
environmentVariables.Add("Radarr_Download_Client", message.DownloadClientName ?? string.Empty);
|
||||
environmentVariables.Add("Radarr_Download_Client_Type", message.DownloadClientType ?? string.Empty);
|
||||
environmentVariables.Add("Radarr_Download_Id", message.DownloadId ?? string.Empty);
|
||||
environmentVariables.Add("Radarr_Release_CustomFormat", string.Join("|", remoteMovie.CustomFormats));
|
||||
environmentVariables.Add("Radarr_Release_CustomFormatScore", remoteMovie.CustomFormatScore.ToString());
|
||||
|
||||
ExecuteScript(environmentVariables);
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace NzbDrone.Core.Parser
|
||||
|
||||
//Handle Exception Release Groups that don't follow -RlsGrp; Manual List
|
||||
// name only...BE VERY CAREFUL WITH THIS, HIGH CHANCE OF FALSE POSITIVES
|
||||
private static readonly Regex ExceptionReleaseGroupRegexExact = new Regex(@"(?<releasegroup>KRaLiMaRKo|E\.N\.D|D\-Z0N3|Koten_Gars|BluDragon|ZØNEHD|Tigole)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
private static readonly Regex ExceptionReleaseGroupRegexExact = new Regex(@"(?<releasegroup>KRaLiMaRKo|E\.N\.D|D\-Z0N3|Koten_Gars|BluDragon|ZØNEHD|Tigole|HQMUX)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
private static readonly Regex WordDelimiterRegex = new Regex(@"(\s|\.|,|_|-|=|'|\|)+", RegexOptions.Compiled);
|
||||
private static readonly Regex SpecialCharRegex = new Regex(@"(\&|\:|\\|\/)+", RegexOptions.Compiled);
|
||||
@@ -265,7 +265,15 @@ namespace NzbDrone.Core.Parser
|
||||
|
||||
if (simpleTitleReplaceString.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
simpleReleaseTitle = simpleReleaseTitle.Replace(simpleTitleReplaceString, simpleTitleReplaceString.Contains(".") ? "A.Movie" : "A Movie");
|
||||
if (match[0].Groups["title"].Success)
|
||||
{
|
||||
simpleReleaseTitle = simpleReleaseTitle.Remove(match[0].Groups["title"].Index, match[0].Groups["title"].Length)
|
||||
.Insert(match[0].Groups["title"].Index, simpleTitleReplaceString.Contains(".") ? "A.Movie" : "A Movie");
|
||||
}
|
||||
else
|
||||
{
|
||||
simpleReleaseTitle = simpleReleaseTitle.Replace(simpleTitleReplaceString, simpleTitleReplaceString.Contains(".") ? "A.Movie" : "A Movie");
|
||||
}
|
||||
}
|
||||
|
||||
result.ReleaseGroup = ParseReleaseGroup(simpleReleaseTitle);
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Radarr.Api.V3.Calendar
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public List<MovieResource> GetCalendar(DateTime? start, DateTime? end, bool unmonitored = false, bool includeArtist = false)
|
||||
public List<MovieResource> GetCalendar(DateTime? start, DateTime? end, bool unmonitored = false)
|
||||
{
|
||||
var startUse = start ?? DateTime.Today;
|
||||
var endUse = end ?? DateTime.Today.AddDays(2);
|
||||
|
||||
@@ -453,14 +453,6 @@
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "includeArtist",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
|
||||
Reference in New Issue
Block a user