Merge branch 'develop' into issue-5148

This commit is contained in:
iceypotato 2023-07-24 15:34:33 -07:00
commit 825e136443
29 changed files with 338 additions and 93 deletions

View File

@ -91,7 +91,8 @@ module.exports = (env) => {
}),
new MiniCssExtractPlugin({
filename: 'Content/styles.css'
filename: 'Content/styles.css',
chunkFilename: 'Content/[id]-[chunkhash].css'
}),
new HtmlWebpackPlugin({

View File

@ -45,14 +45,14 @@ class QueueRow extends Component {
this.setState({ isRemoveQueueItemModalOpen: true });
};
onRemoveQueueItemModalConfirmed = (blocklist) => {
onRemoveQueueItemModalConfirmed = (blocklist, skipRedownload) => {
const {
onRemoveQueueItemPress,
onQueueRowModalOpenOrClose
} = this.props;
onQueueRowModalOpenOrClose(false);
onRemoveQueueItemPress(blocklist);
onRemoveQueueItemPress(blocklist, skipRedownload);
this.setState({ isRemoveQueueItemModalOpen: false });
};

View File

@ -10,6 +10,7 @@ import ModalContent from 'Components/Modal/ModalContent';
import ModalFooter from 'Components/Modal/ModalFooter';
import ModalHeader from 'Components/Modal/ModalHeader';
import { inputTypes, kinds, sizes } from 'Helpers/Props';
import translate from 'Utilities/String/translate';
class RemoveQueueItemModal extends Component {
@ -21,7 +22,8 @@ class RemoveQueueItemModal extends Component {
this.state = {
remove: true,
blocklist: false
blocklist: false,
skipRedownload: false
};
}
@ -31,7 +33,8 @@ class RemoveQueueItemModal extends Component {
resetState = function() {
this.setState({
remove: true,
blocklist: false
blocklist: false,
skipRedownload: false
});
};
@ -46,6 +49,10 @@ class RemoveQueueItemModal extends Component {
this.setState({ blocklist: value });
};
onSkipRedownloadChange = ({ value }) => {
this.setState({ skipRedownload: value });
};
onRemoveConfirmed = () => {
const state = this.state;
@ -69,7 +76,7 @@ class RemoveQueueItemModal extends Component {
isPending
} = this.props;
const { remove, blocklist } = this.state;
const { remove, blocklist, skipRedownload } = this.state;
return (
<Modal
@ -118,6 +125,20 @@ class RemoveQueueItemModal extends Component {
/>
</FormGroup>
{
blocklist ?
<FormGroup>
<FormLabel>{translate('SkipRedownload')}</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="skipRedownload"
value={skipRedownload}
helpText={translate('SkipRedownloadHelpText')}
onChange={this.onSkipRedownloadChange}
/>
</FormGroup> :
null
}
</ModalBody>
<ModalFooter>

View File

@ -23,7 +23,8 @@ class RemoveQueueItemsModal extends Component {
this.state = {
remove: true,
blocklist: false
blocklist: false,
skipRedownload: false
};
}
@ -33,7 +34,8 @@ class RemoveQueueItemsModal extends Component {
resetState = function() {
this.setState({
remove: true,
blocklist: false
blocklist: false,
skipRedownload: false
});
};
@ -48,6 +50,10 @@ class RemoveQueueItemsModal extends Component {
this.setState({ blocklist: value });
};
onSkipRedownloadChange = ({ value }) => {
this.setState({ skipRedownload: value });
};
onRemoveConfirmed = () => {
const state = this.state;
@ -71,7 +77,7 @@ class RemoveQueueItemsModal extends Component {
allPending
} = this.props;
const { remove, blocklist } = this.state;
const { remove, blocklist, skipRedownload } = this.state;
return (
<Modal
@ -122,6 +128,20 @@ class RemoveQueueItemsModal extends Component {
/>
</FormGroup>
{
blocklist ?
<FormGroup>
<FormLabel>{translate('SkipRedownload')}</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="skipRedownload"
value={skipRedownload}
helpText={translate('SkipRedownloadHelpText')}
onChange={this.onSkipRedownloadChange}
/>
</FormGroup> :
null
}
</ModalBody>
<ModalFooter>

View File

@ -1,3 +1,11 @@
.tableScroller {
position: relative;
}
.row {
transition: background-color 500ms;
&:hover {
background-color: var(--tableRowHoverBackgroundColor);
}
}

View File

@ -1,6 +1,7 @@
// This file is automatically generated.
// Please do not change this file!
interface CssExports {
'row': string;
'tableScroller': string;
}
export const cssExports: CssExports;

View File

@ -65,6 +65,7 @@ const Row: React.FC<ListChildComponentProps<RowItemData>> = ({
justifyContent: 'space-between',
...style,
}}
className={styles.row}
>
<SeriesIndexRow
seriesId={series.id}

View File

@ -35,7 +35,7 @@ class MonitoringOptionsModalContent extends Component {
const {
isSaving,
saveError
} = prevProps;
} = this.props;
if (prevProps.isSaving && !isSaving && !saveError) {
this.setState({

View File

@ -30,28 +30,28 @@ const caseOptions = [
const fileNameTokens = [
{
token: '{Series Title} - S{season:00}E{episode:00} - {Episode Title} {Quality Full}',
example: 'Series Title (2010) - S01E01 - Episode Title HDTV-720p Proper'
example: 'The Series Title\'s! (2010) - S01E01 - Episode Title HDTV-720p Proper'
},
{
token: '{Series Title} - {season:0}x{episode:00} - {Episode Title} {Quality Full}',
example: 'Series Title (2010) - 1x01 - Episode Title HDTV-720p Proper'
example: 'The Series Title\'s! (2010) - 1x01 - Episode Title HDTV-720p Proper'
},
{
token: '{Series.Title}.S{season:00}E{episode:00}.{EpisodeClean.Title}.{Quality.Full}',
example: 'Series.Title.(2010).S01E01.Episode.Title.HDTV-720p'
example: 'The.Series.Title\'s!.(2010).S01E01.Episode.Title.HDTV-720p'
}
];
const seriesTokens = [
{ token: '{Series Title}', example: 'Series Title\'s' },
{ token: '{Series CleanTitle}', example: 'Series Titles' },
{ token: '{Series CleanTitleYear}', example: 'Series Titles! 2010' },
{ token: '{Series CleanTitleWithoutYear}', example: 'Series Titles!' },
{ token: '{Series TitleThe}', example: 'Series Title\'s, The' },
{ token: '{Series TitleTheYear}', example: 'Series Title\'s, The (2010)' },
{ token: '{Series TitleTheWithoutYear}', example: 'Series Title\'s, The' },
{ token: '{Series TitleYear}', example: 'Series Title\'s (2010)' },
{ token: '{Series TitleWithoutYear}', example: 'Series Title\'s' },
{ token: '{Series Title}', example: 'The Series Title\'s!' },
{ token: '{Series CleanTitle}', example: 'The Series Title\'s!' },
{ token: '{Series CleanTitleYear}', example: 'The Series Titles! 2010' },
{ token: '{Series CleanTitleWithoutYear}', example: 'The Series Title\'s!' },
{ token: '{Series TitleThe}', example: 'Series Title\'s!, The' },
{ token: '{Series TitleTheYear}', example: 'Series Title\'s!, The (2010)' },
{ token: '{Series TitleTheWithoutYear}', example: 'Series Title\'s!, The' },
{ token: '{Series TitleYear}', example: 'The Series Title\'s! (2010)' },
{ token: '{Series TitleWithoutYear}', example: 'Series Title\'s!' },
{ token: '{Series TitleFirstCharacter}', example: 'S' },
{ token: '{Series Year}', example: '2010' }
];
@ -89,8 +89,8 @@ const episodeTitleTokens = [
];
const qualityTokens = [
{ token: '{Quality Full}', example: 'HDTV-720p Proper' },
{ token: '{Quality Title}', example: 'HDTV-720p' }
{ token: '{Quality Full}', example: 'WEBDL-1080p Proper' },
{ token: '{Quality Title}', example: 'WEBDL-1080p' }
];
const mediaInfoTokens = [
@ -114,8 +114,8 @@ const otherTokens = [
];
const originalTokens = [
{ token: '{Original Title}', example: 'Series.Title.S01E01.HDTV.x264-EVOLVE' },
{ token: '{Original Filename}', example: 'series.title.s01e01.hdtv.x264-EVOLVE' }
{ token: '{Original Title}', example: 'The.Series.Title\'s!.S01E01.WEBDL.1080p.x264-EVOLVE' },
{ token: '{Original Filename}', example: 'the.series.title\'s!.s01e01.webdl.1080p.x264-EVOLVE' }
];
class NamingModal extends Component {

View File

@ -381,13 +381,14 @@ export const actionHandlers = handleThunks({
const {
id,
remove,
blocklist
blocklist,
skipRedownload
} = payload;
dispatch(updateItem({ section: paged, id, isRemoving: true }));
const promise = createAjaxRequest({
url: `/queue/${id}?removeFromClient=${remove}&blocklist=${blocklist}`,
url: `/queue/${id}?removeFromClient=${remove}&blocklist=${blocklist}&skipRedownload=${skipRedownload}`,
method: 'DELETE'
}).request;
@ -404,7 +405,8 @@ export const actionHandlers = handleThunks({
const {
ids,
remove,
blocklist
blocklist,
skipRedownload
} = payload;
dispatch(batchActions([
@ -420,7 +422,7 @@ export const actionHandlers = handleThunks({
]));
const promise = createAjaxRequest({
url: `/queue/bulk?removeFromClient=${remove}&blocklist=${blocklist}`,
url: `/queue/bulk?removeFromClient=${remove}&blocklist=${blocklist}&skipRedownload=${skipRedownload}`,
method: 'DELETE',
dataType: 'json',
contentType: 'application/json',

View File

@ -54,10 +54,14 @@ class MoreInfo extends Component {
{translate('IRC')}
</DescriptionListItemTitle>
<DescriptionListItemDescription>
<Link to="irc://irc.libera.chat/#sonarr">#sonarr on Libera</Link>
<Link to="irc://irc.libera.chat/#sonarr">
{translate('IRCLinkText')}
</Link>
</DescriptionListItemDescription>
<DescriptionListItemDescription>
<Link to="https://web.libera.chat/?channels=#sonarr">Libera webchat</Link>
<Link to="https://web.libera.chat/?channels=#sonarr">
{translate('LiberaWebchat')}
</Link>
</DescriptionListItemDescription>
<DescriptionListItemTitle>

View File

@ -70,6 +70,8 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
[TestCase("[a] title", "a title")]
[TestCase("backslash \\ backlash", "backslash backlash")]
[TestCase("I'm the Boss", "Im the Boss")]
[TestCase("The Title's", "The Title's")]
[TestCase("I'm after I'm", "Im after I'm")]
// [TestCase("", "")]
public void should_get_expected_title_back(string title, string expected)

View File

@ -54,6 +54,8 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
[TestCase("The Mist", 2018, "The Mist")]
[TestCase("The Rat Pack (A&E)", 1999, "The Rat Pack AandE")]
[TestCase("The Climax: I (Almost) Got Away With It (2016)", 2016, "The Climax I Almost Got Away With It")]
[TestCase("The Series Title's (2016)", 2016, "The Series Titles")]
[TestCase("The Series Title's", 2016, "The Series Title's")]
public void should_get_expected_title_back(string title, int year, string expected)
{
_series.Title = title;

View File

@ -54,6 +54,7 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
[TestCase("The Mist", 2018, "The Mist 2018")]
[TestCase("The Rat Pack (A&E)", 1999, "The Rat Pack AandE 1999")]
[TestCase("The Climax: I (Almost) Got Away With It (2016)", 2016, "The Climax I Almost Got Away With It 2016")]
[TestCase("The Series Title's", 2016, "The Series Titles 2016")]
public void should_get_expected_title_back(string title, int year, string expected)
{
_series.Title = title;

View File

@ -23,5 +23,6 @@ namespace NzbDrone.Core.Download
public Dictionary<string, string> Data { get; set; }
public TrackedDownload TrackedDownload { get; set; }
public List<Language> Languages { get; set; }
public bool SkipRedownload { get; set; }
}
}

View File

@ -9,8 +9,8 @@ namespace NzbDrone.Core.Download
{
public interface IFailedDownloadService
{
void MarkAsFailed(int historyId);
void MarkAsFailed(string downloadId);
void MarkAsFailed(int historyId, bool skipRedownload = false);
void MarkAsFailed(string downloadId, bool skipRedownload = false);
void Check(TrackedDownload trackedDownload);
void ProcessFailed(TrackedDownload trackedDownload);
}
@ -30,14 +30,14 @@ namespace NzbDrone.Core.Download
_eventAggregator = eventAggregator;
}
public void MarkAsFailed(int historyId)
public void MarkAsFailed(int historyId, bool skipRedownload = false)
{
var history = _historyService.Get(historyId);
var downloadId = history.DownloadId;
if (downloadId.IsNullOrWhiteSpace())
{
PublishDownloadFailedEvent(new List<EpisodeHistory> { history }, "Manually marked as failed");
PublishDownloadFailedEvent(new List<EpisodeHistory> { history }, "Manually marked as failed", skipRedownload: skipRedownload);
return;
}
@ -57,7 +57,7 @@ namespace NzbDrone.Core.Download
PublishDownloadFailedEvent(grabbedHistory, "Manually marked as failed");
}
public void MarkAsFailed(string downloadId)
public void MarkAsFailed(string downloadId, bool skipRedownload = false)
{
var history = _historyService.Find(downloadId, EpisodeHistoryEventType.Grabbed);
@ -65,7 +65,7 @@ namespace NzbDrone.Core.Download
{
var trackedDownload = _trackedDownloadService.Find(downloadId);
PublishDownloadFailedEvent(history, "Manually marked as failed", trackedDownload);
PublishDownloadFailedEvent(history, "Manually marked as failed", trackedDownload, skipRedownload: skipRedownload);
}
}
@ -125,7 +125,7 @@ namespace NzbDrone.Core.Download
PublishDownloadFailedEvent(grabbedItems, failure, trackedDownload);
}
private void PublishDownloadFailedEvent(List<EpisodeHistory> historyItems, string message, TrackedDownload trackedDownload = null)
private void PublishDownloadFailedEvent(List<EpisodeHistory> historyItems, string message, TrackedDownload trackedDownload = null, bool skipRedownload = false)
{
var historyItem = historyItems.First();
@ -140,7 +140,8 @@ namespace NzbDrone.Core.Download
Message = message,
Data = historyItem.Data,
TrackedDownload = trackedDownload,
Languages = historyItem.Languages
Languages = historyItem.Languages,
SkipRedownload = skipRedownload
};
_eventAggregator.PublishEvent(downloadFailedEvent);

View File

@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using NLog;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.IndexerSearch;
@ -30,6 +30,12 @@ namespace NzbDrone.Core.Download
[EventHandleOrder(EventHandleOrder.Last)]
public void Handle(DownloadFailedEvent message)
{
if (message.SkipRedownload)
{
_logger.Debug("Skip redownloading requested by user");
return;
}
if (!_configService.AutoRedownloadFailed)
{
_logger.Debug("Auto redownloading failed episodes is disabled");

View File

@ -11,6 +11,7 @@ namespace NzbDrone.Core.ImportLists.Simkl
public string Imdb { get; set; }
public string Tmdb { get; set; }
public string Tvdb { get; set; }
public string Mal { get; set; }
}
public class SimklSeriesPropsResource
@ -23,11 +24,15 @@ namespace NzbDrone.Core.ImportLists.Simkl
public class SimklSeriesResource
{
public SimklSeriesPropsResource Show { get; set; }
[JsonProperty("anime_type")]
public SimklAnimeType AnimeType { get; set; }
}
public class SimklResponse
{
public List<SimklSeriesResource> Shows { get; set; }
public List<SimklSeriesResource> Anime { get; set; }
}
public class RefreshRequestResponse
@ -66,4 +71,10 @@ namespace NzbDrone.Core.ImportLists.Simkl
{
public DateTime All { get; set; }
}
public enum SimklAnimeType
{
Tv,
Movie
}
}

View File

@ -1,6 +1,8 @@
using System.Collections.Generic;
using System.Net;
using NLog;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Instrumentation;
using NzbDrone.Common.Serializer;
using NzbDrone.Core.ImportLists.Exceptions;
using NzbDrone.Core.Parser.Model;
@ -10,6 +12,11 @@ namespace NzbDrone.Core.ImportLists.Simkl
public class SimklParser : IParseImportListResponse
{
private ImportListResponse _importResponse;
private static readonly Logger Logger = NzbDroneLogger.GetLogger(typeof(SimklParser));
public SimklParser()
{
}
public virtual IList<ImportListItemInfo> ParseResponse(ImportListResponse importResponse)
{
@ -22,7 +29,7 @@ namespace NzbDrone.Core.ImportLists.Simkl
return series;
}
var jsonResponse = STJson.Deserialize<SimklResponse>(_importResponse.Content);
var jsonResponse = Json.Deserialize<SimklResponse>(_importResponse.Content);
// no shows were return
if (jsonResponse == null)
@ -30,14 +37,40 @@ namespace NzbDrone.Core.ImportLists.Simkl
return series;
}
foreach (var show in jsonResponse.Shows)
if (jsonResponse.Anime != null)
{
series.AddIfNotNull(new ImportListItemInfo()
foreach (var show in jsonResponse.Anime)
{
Title = show.Show.Title,
TvdbId = int.TryParse(show.Show.Ids.Tvdb, out var tvdbId) ? tvdbId : 0,
ImdbId = show.Show.Ids.Imdb
});
var tentativeTvdbId = int.TryParse(show.Show.Ids.Tvdb, out var tvdbId) ? tvdbId : 0;
if (tentativeTvdbId > 0 && show.AnimeType == SimklAnimeType.Tv)
{
series.AddIfNotNull(new ImportListItemInfo()
{
Title = show.Show.Title,
ImdbId = show.Show.Ids.Imdb,
TvdbId = tvdbId,
MalId = int.TryParse(show.Show.Ids.Mal, out var malId) ? malId : 0
});
}
else
{
Logger.Warn("Skipping info grabbing for '{0}' because it is a movie or it is not the first season of the show", show.Show.Title);
}
}
}
if (jsonResponse.Shows != null)
{
foreach (var show in jsonResponse.Shows)
{
series.AddIfNotNull(new ImportListItemInfo()
{
Title = show.Show.Title,
TvdbId = int.TryParse(show.Show.Ids.Tvdb, out var tvdbId) ? tvdbId : 0,
ImdbId = show.Show.Ids.Imdb
});
}
}
return series;

View File

@ -21,7 +21,7 @@ namespace NzbDrone.Core.ImportLists.Simkl.User
private IEnumerable<ImportListRequest> GetSeriesRequest()
{
var link = $"{Settings.BaseUrl.Trim()}/sync/all-items/shows/{((SimklUserListType)Settings.ListType).ToString().ToLowerInvariant()}";
var link = $"{Settings.BaseUrl.Trim()}/sync/all-items/{((SimklUserShowType)Settings.ShowType).ToString().ToLowerInvariant()}/{((SimklUserListType)Settings.ListType).ToString().ToLowerInvariant()}";
var request = new ImportListRequest(link, HttpAccept.Json);

View File

@ -19,9 +19,13 @@ namespace NzbDrone.Core.ImportLists.Simkl.User
public SimklUserSettings()
{
ListType = (int)SimklUserListType.Watching;
ShowType = (int)SimklUserShowType.Shows;
}
[FieldDefinition(1, Label = "List Type", Type = FieldType.Select, SelectOptions = typeof(SimklUserListType), HelpText = "Type of list you're seeking to import from")]
public int ListType { get; set; }
[FieldDefinition(1, Label = "Show Type", Type = FieldType.Select, SelectOptions = typeof(SimklUserShowType), HelpText = "Type of show you're seeking to import from")]
public int ShowType { get; set; }
}
}

View File

@ -0,0 +1,8 @@
namespace NzbDrone.Core.ImportLists.Simkl.User
{
public enum SimklUserShowType
{
Shows = 0,
Anime = 1
}
}

View File

@ -139,12 +139,14 @@
"InstallLatest": "Install Latest",
"Interval": "Interval",
"IRC": "IRC",
"IRCLinkText": "#sonarr on Libera",
"Language": "Language",
"Language that Sonarr will use for UI": "Language that Sonarr will use for UI",
"Languages": "Languages",
"LastDuration": "Last Duration",
"LastExecution": "Last Execution",
"LastWriteTime": "Last Write Time",
"LiberaWebchat": "Libera Webchat",
"LibraryImport": "Library Import",
"Location": "Location",
"LogFiles": "Log Files",
@ -189,7 +191,7 @@
"NoSeasons": "No seasons",
"NoUpdatesAreAvailable": "No updates are available",
"OneSeason": "1 season",
"OnLatestVersion": "The latest version of Radarr is already installed",
"OnLatestVersion": "The latest version of Sonarr is already installed",
"Options": "Options",
"OriginalLanguage": "Original Language",
"PackageVersion": "Package Version",
@ -276,6 +278,8 @@
"ShownClickToHide": "Shown, click to hide",
"Size": "Size",
"SizeOnDisk": "Size on disk",
"SkipRedownloadHelpText": "Prevents Sonarr from trying to download an alternative release for this item",
"SkipRedownload": "Skip Redownload",
"Source": "Source",
"Special": "Special",
"Started": "Started",

View File

@ -214,5 +214,100 @@
"SeasonNumber": "Número da Temporada",
"SeriesTitle": "Título da Série",
"Special": "Especial",
"TestParsing": "Análise de Teste"
"TestParsing": "Análise de Teste",
"About": "Sobre",
"Actions": "Ações",
"AppDataDirectory": "Diretório AppData",
"AptUpdater": "Usar apt para instalar atualizações",
"BackupNow": "Fazer Backup Agora",
"Backups": "Backups",
"BeforeUpdate": "Antes de atualizar",
"CancelPendingTask": "Tem certeza de que deseja cancelar esta tarefa pendente?",
"Clear": "Limpar",
"CurrentlyInstalled": "Atualmente instalado",
"DeleteBackup": "Excluir Backup",
"DeleteBackupMessageText": "Tem certeza de que deseja excluir o backup '{name}'?",
"Discord": "Discord",
"DiskSpace": "Espaço em Disco",
"Docker": "Docker",
"DockerUpdater": "Atualize o contêiner docker para receber a atualização",
"Donations": "Doações",
"DotNetVersion": ".NET",
"Download": "Baixar",
"Duration": "Duração",
"ErrorRestoringBackup": "Erro ao restaurar o backup",
"Exception": "Exceção",
"ExternalUpdater": "O Sonarr está configurado para usar um mecanismo de atualização externo",
"FailedToFetchUpdates": "Falha ao buscar atualizações",
"FailedToUpdateSettings": "Falha ao atualizar as configurações",
"FeatureRequests": "Solicitações de recursos",
"Filename": "Nome do arquivo",
"Fixed": "Corrigido",
"Forums": "Fóruns",
"FreeSpace": "Espaço Livre",
"From": "De",
"GeneralSettings": "Configurações Gerais",
"Health": "Saúde",
"HomePage": "Página Inicial",
"OnLatestVersion": "A versão mais recente do Sonarr já está instalada",
"InstallLatest": "Instalar o mais recente",
"Interval": "Intervalo",
"IRC": "IRC",
"LastDuration": "Última Duração",
"LastExecution": "Última Execução",
"LastWriteTime": "Hora da Última Gravação",
"Location": "Localização",
"LogFilesLocation": "Os arquivos de log estão localizados em: {location}",
"Logs": "Logs",
"MaintenanceRelease": "Versão de manutenção: correções de bugs e outras melhorias. Veja Github Commit History para mais detalhes",
"Manual": "Manual",
"Message": "Mensagem",
"Mode": "Modo",
"MoreInfo": "Mais informações",
"New": "Novo",
"NextExecution": "Próxima Execução",
"NoBackupsAreAvailable": "Não há backups disponíveis",
"NoEventsFound": "Nenhum evento encontrado",
"NoIssuesWithYourConfiguration": "Sem problemas com sua configuração",
"NoLeaveIt": "Não, deixe-o",
"NoLogFiles": "Nenhum arquivo de log",
"NoUpdatesAreAvailable": "Nenhuma atualização está disponível",
"Options": "Opções",
"PackageVersion": "Versão do pacote",
"PackageVersionInfo": "{packageVersion} por {packageAuthor}",
"PreviouslyInstalled": "Instalado anteriormente",
"Queued": "Enfileirados",
"ReadTheWikiForMoreInformation": "Leia o Wiki para mais informações",
"Refresh": "Atualizar",
"Reload": "Recarregar",
"RemovedFromTaskQueue": "Removido da fila de tarefas",
"Restart": "Reiniciar",
"TaskUserAgentTooltip": "User-Agent fornecido pelo aplicativo que chamou a API",
"ResetQualityDefinitions": "Redefinir Definições de Qualidade",
"ResetQualityDefinitionsMessageText": "Tem certeza de que deseja redefinir as definições de qualidade?",
"ResetTitles": "Redefinir Títulos",
"Restore": "Restaurar",
"RestoreBackup": "Restaurar backup",
"Scheduled": "Agendado",
"SeriesEditor": "Editor de séries",
"Size": "Tamanho",
"Source": "Fonte",
"Started": "Iniciado",
"StartupDirectory": "Diretório de inicialização",
"Status": "Estado",
"TestAll": "Testar Tudo",
"TheLogLevelDefault": "O padrão do nível de log é 'Info' e pode ser alterado em [Configurações gerais](/configurações /geral)",
"Time": "Horário",
"TotalSpace": "Espaço Total",
"Twitter": "Twitter",
"UnableToLoadBackups": "Não foi possível carregar os backups",
"UnableToUpdateSonarrDirectly": "Incapaz de atualizar o Sonarr diretamente,",
"UpdaterLogFiles": "Arquivos de log do atualizador",
"Uptime": "Tempo de atividade",
"Wiki": "Wiki",
"WouldYouLikeToRestoreBackup": "Gostaria de restaurar o backup '{name}'?",
"YesCancel": "Sim, Cancelar",
"Reset": "Redefinir",
"ResetDefinitionTitlesHelpText": "Redefinir títulos de definição, bem como valores",
"RestartReloadNote": "Observação: o Sonarr reiniciará automaticamente e recarregará a IU durante o processo de restauração."
}

View File

@ -44,7 +44,7 @@ namespace NzbDrone.Core.Organizer
_standardSeries = new Series
{
SeriesType = SeriesTypes.Standard,
Title = "The Series Title!",
Title = "The Series Title's!",
Year = 2010,
ImdbId = "tt12345",
TvdbId = 12345,
@ -54,7 +54,7 @@ namespace NzbDrone.Core.Organizer
_dailySeries = new Series
{
SeriesType = SeriesTypes.Daily,
Title = "The Series Title!",
Title = "The Series Title's!",
Year = 2010,
ImdbId = "tt12345",
TvdbId = 12345,
@ -64,7 +64,7 @@ namespace NzbDrone.Core.Organizer
_animeSeries = new Series
{
SeriesType = SeriesTypes.Anime,
Title = "The Series Title!",
Title = "The Series Title's!",
Year = 2010,
ImdbId = "tt12345",
TvdbId = 12345,
@ -141,45 +141,45 @@ namespace NzbDrone.Core.Organizer
_singleEpisodeFile = new EpisodeFile
{
Quality = new QualityModel(Quality.HDTV720p, new Revision(2)),
RelativePath = "Series.Title.S01E01.720p.HDTV.x264-EVOLVE.mkv",
SceneName = "Series.Title.S01E01.720p.HDTV.x264-EVOLVE",
Quality = new QualityModel(Quality.WEBDL1080p, new Revision(2)),
RelativePath = "The.Series.Title's!.S01E01.1080p.WEBDL.x264-EVOLVE.mkv",
SceneName = "The.Series.Title's!.S01E01.1080p.WEBDL.x264-EVOLVE",
ReleaseGroup = "RlsGrp",
MediaInfo = mediaInfo
};
_multiEpisodeFile = new EpisodeFile
{
Quality = new QualityModel(Quality.HDTV720p, new Revision(2)),
RelativePath = "Series.Title.S01E01-E03.720p.HDTV.x264-EVOLVE.mkv",
SceneName = "Series.Title.S01E01-E03.720p.HDTV.x264-EVOLVE",
Quality = new QualityModel(Quality.WEBDL1080p, new Revision(2)),
RelativePath = "The.Series.Title's!.S01E01-E03.1080p.WEBDL.x264-EVOLVE.mkv",
SceneName = "The.Series.Title's!.S01E01-E03.1080p.WEBDL.x264-EVOLVE",
ReleaseGroup = "RlsGrp",
MediaInfo = mediaInfo,
};
_dailyEpisodeFile = new EpisodeFile
{
Quality = new QualityModel(Quality.HDTV720p, new Revision(2)),
RelativePath = "Series.Title.2013.10.30.HDTV.x264-EVOLVE.mkv",
SceneName = "Series.Title.2013.10.30.HDTV.x264-EVOLVE",
Quality = new QualityModel(Quality.WEBDL1080p, new Revision(2)),
RelativePath = "The.Series.Title's!.2013.10.30.1080p.WEBDL.x264-EVOLVE.mkv",
SceneName = "The.Series.Title's!.2013.10.30.1080p.WEBDL.x264-EVOLVE",
ReleaseGroup = "RlsGrp",
MediaInfo = mediaInfo
};
_animeEpisodeFile = new EpisodeFile
{
Quality = new QualityModel(Quality.HDTV720p, new Revision(2)),
RelativePath = "[RlsGroup] Series Title - 001 [720p].mkv",
SceneName = "[RlsGroup] Series Title - 001 [720p]",
Quality = new QualityModel(Quality.WEBDL1080p, new Revision(2)),
RelativePath = "[RlsGroup] The Series Title's! - 001 [1080P].mkv",
SceneName = "[RlsGroup] The Series Title's! - 001 [1080P]",
ReleaseGroup = "RlsGrp",
MediaInfo = mediaInfoAnime
};
_animeMultiEpisodeFile = new EpisodeFile
{
Quality = new QualityModel(Quality.HDTV720p, new Revision(2)),
RelativePath = "[RlsGroup] Series Title - 001 - 103 [720p].mkv",
SceneName = "[RlsGroup] Series Title - 001 - 103 [720p]",
Quality = new QualityModel(Quality.WEBDL1080p, new Revision(2)),
RelativePath = "[RlsGroup] The Series Title's! - 001 - 103 [1080p].mkv",
SceneName = "[RlsGroup] The Series Title's! - 001 - 103 [1080p]",
ReleaseGroup = "RlsGrp",
MediaInfo = mediaInfoAnime
};

View File

@ -11,6 +11,7 @@ namespace NzbDrone.Core.Parser.Model
public int TvdbId { get; set; }
public int TmdbId { get; set; }
public string ImdbId { get; set; }
public int MalId { get; set; }
public DateTime ReleaseDate { get; set; }
public override string ToString()

View File

@ -70,7 +70,7 @@ namespace Sonarr.Api.V3.Queue
}
[RestDeleteById]
public void RemoveAction(int id, bool removeFromClient = true, bool blocklist = false)
public void RemoveAction(int id, bool removeFromClient = true, bool blocklist = false, bool skipRedownload = false)
{
var pendingRelease = _pendingReleaseService.FindPendingQueueItem(id);
@ -88,12 +88,12 @@ namespace Sonarr.Api.V3.Queue
throw new NotFoundException();
}
Remove(trackedDownload, removeFromClient, blocklist);
Remove(trackedDownload, removeFromClient, blocklist, skipRedownload);
_trackedDownloadService.StopTracking(trackedDownload.DownloadItem.DownloadId);
}
[HttpDelete("bulk")]
public object RemoveMany([FromBody] QueueBulkResource resource, [FromQuery] bool removeFromClient = true, [FromQuery] bool blocklist = false)
public object RemoveMany([FromBody] QueueBulkResource resource, [FromQuery] bool removeFromClient = true, [FromQuery] bool blocklist = false, [FromQuery] bool skipRedownload = false)
{
var trackedDownloadIds = new List<string>();
var pendingToRemove = new List<NzbDrone.Core.Queue.Queue>();
@ -124,7 +124,7 @@ namespace Sonarr.Api.V3.Queue
foreach (var trackedDownload in trackedToRemove.DistinctBy(t => t.DownloadItem.DownloadId))
{
Remove(trackedDownload, removeFromClient, blocklist);
Remove(trackedDownload, removeFromClient, blocklist, skipRedownload);
trackedDownloadIds.Add(trackedDownload.DownloadItem.DownloadId);
}
@ -255,7 +255,7 @@ namespace Sonarr.Api.V3.Queue
_pendingReleaseService.RemovePendingQueueItems(pendingRelease.Id);
}
private TrackedDownload Remove(TrackedDownload trackedDownload, bool removeFromClient, bool blocklist)
private TrackedDownload Remove(TrackedDownload trackedDownload, bool removeFromClient, bool blocklist, bool skipRedownload)
{
if (removeFromClient)
{
@ -271,7 +271,7 @@ namespace Sonarr.Api.V3.Queue
if (blocklist)
{
_failedDownloadService.MarkAsFailed(trackedDownload.DownloadItem.DownloadId);
_failedDownloadService.MarkAsFailed(trackedDownload.DownloadItem.DownloadId, skipRedownload);
}
if (!removeFromClient && !blocklist)

View File

@ -5132,6 +5132,14 @@
"type": "boolean",
"default": false
}
},
{
"name": "skipRedownload",
"in": "query",
"schema": {
"type": "boolean",
"default": false
}
}
],
"responses": {
@ -5162,6 +5170,14 @@
"type": "boolean",
"default": false
}
},
{
"name": "skipRedownload",
"in": "query",
"schema": {
"type": "boolean",
"default": false
}
}
],
"requestBody": {

View File

@ -123,7 +123,7 @@ namespace Sonarr.Http.ClientSchema
Placeholder = fieldAttribute.Placeholder
};
if (fieldAttribute.Type == FieldType.Select || fieldAttribute.Type == FieldType.TagSelect)
if (fieldAttribute.Type is FieldType.Select or FieldType.TagSelect)
{
if (fieldAttribute.SelectOptionsProviderAction.IsNotNullOrWhiteSpace())
{
@ -172,31 +172,33 @@ namespace Sonarr.Http.ClientSchema
{
if (selectOptions.IsEnum)
{
var options = selectOptions.GetFields().Where(v => v.IsStatic).Select(v =>
{
var name = v.Name.Replace('_', ' ');
var value = Convert.ToInt32(v.GetRawConstantValue());
var attrib = v.GetCustomAttribute<FieldOptionAttribute>();
if (attrib != null)
var options = selectOptions
.GetFields()
.Where(v => v.IsStatic && !v.GetCustomAttributes(false).OfType<ObsoleteAttribute>().Any())
.Select(v =>
{
return new SelectOption
var name = v.Name.Replace('_', ' ');
var value = Convert.ToInt32(v.GetRawConstantValue());
var attrib = v.GetCustomAttribute<FieldOptionAttribute>();
if (attrib != null)
{
Value = value,
Name = attrib.Label ?? name,
Order = attrib.Order,
Hint = attrib.Hint ?? $"({value})"
};
}
else
{
return new SelectOption
{
Value = value,
Name = attrib.Label ?? name,
Order = attrib.Order,
Hint = attrib.Hint ?? $"({value})"
};
}
return new SelectOption
{
Value = value,
Name = name,
Order = value
};
}
});
});
return options.OrderBy(o => o.Order).ToList();
}