mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 03:52:33 +02:00
clear existing scene name since it wasn't storing the correct string
This commit is contained in:
parent
c25b92955f
commit
dd835d5503
15
NzbDrone.Core/Datastore/Migration/017_reset_scene_names.cs
Normal file
15
NzbDrone.Core/Datastore/Migration/017_reset_scene_names.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
using FluentMigrator;
|
||||||
|
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.Datastore.Migration
|
||||||
|
{
|
||||||
|
[Migration(17)]
|
||||||
|
public class reset_scene_names : NzbDroneMigrationBase
|
||||||
|
{
|
||||||
|
protected override void MainDbUpgrade()
|
||||||
|
{
|
||||||
|
//we were storing new file name as scene name.
|
||||||
|
Execute.Sql(@"UPDATE EpisodeFiles SET SceneName = NULL where SceneName != NULL");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -62,12 +62,12 @@ public List<ImportDecision> Import(List<ImportDecision> decisions, bool newDownl
|
|||||||
episodeFile.Size = _diskProvider.GetFileSize(localEpisode.Path);
|
episodeFile.Size = _diskProvider.GetFileSize(localEpisode.Path);
|
||||||
episodeFile.Quality = localEpisode.Quality;
|
episodeFile.Quality = localEpisode.Quality;
|
||||||
episodeFile.SeasonNumber = localEpisode.SeasonNumber;
|
episodeFile.SeasonNumber = localEpisode.SeasonNumber;
|
||||||
episodeFile.SceneName = Path.GetFileNameWithoutExtension(localEpisode.Path.CleanFilePath());
|
|
||||||
episodeFile.Episodes = localEpisode.Episodes;
|
episodeFile.Episodes = localEpisode.Episodes;
|
||||||
|
|
||||||
|
|
||||||
if (newDownload)
|
if (newDownload)
|
||||||
{
|
{
|
||||||
|
episodeFile.SceneName = Path.GetFileNameWithoutExtension(localEpisode.Path.CleanFilePath());
|
||||||
episodeFile.Path = _episodeFileUpgrader.UpgradeEpisodeFile(episodeFile, localEpisode);
|
episodeFile.Path = _episodeFileUpgrader.UpgradeEpisodeFile(episodeFile, localEpisode);
|
||||||
_messageAggregator.PublishEvent(new EpisodeImportedEvent(localEpisode, episodeFile));
|
_messageAggregator.PublishEvent(new EpisodeImportedEvent(localEpisode, episodeFile));
|
||||||
_messageAggregator.PublishEvent(new EpisodeDownloadedEvent(localEpisode));
|
_messageAggregator.PublishEvent(new EpisodeDownloadedEvent(localEpisode));
|
||||||
|
@ -159,6 +159,7 @@
|
|||||||
<Compile Include="Datastore\Migration\014_drop_air_date.cs" />
|
<Compile Include="Datastore\Migration\014_drop_air_date.cs" />
|
||||||
<Compile Include="Datastore\Migration\015_add_air_date_as_string.cs" />
|
<Compile Include="Datastore\Migration\015_add_air_date_as_string.cs" />
|
||||||
<Compile Include="Datastore\Migration\016_updated_imported_history_item.cs" />
|
<Compile Include="Datastore\Migration\016_updated_imported_history_item.cs" />
|
||||||
|
<Compile Include="Datastore\Migration\017_reset_scene_names.cs" />
|
||||||
<Compile Include="Datastore\Migration\Framework\MigrationContext.cs" />
|
<Compile Include="Datastore\Migration\Framework\MigrationContext.cs" />
|
||||||
<Compile Include="Datastore\Migration\Framework\MigrationController.cs" />
|
<Compile Include="Datastore\Migration\Framework\MigrationController.cs" />
|
||||||
<Compile Include="Datastore\Migration\Framework\MigrationExtension.cs" />
|
<Compile Include="Datastore\Migration\Framework\MigrationExtension.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user