Cleanup: Cleanup Import/Parsing Files

pull/250/head
Qstick 7 years ago
parent 254b3fcfbe
commit 0f3934454b

@ -6,13 +6,11 @@ using NzbDrone.Core.Download;
using NzbDrone.Core.MediaFiles.Events;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Parser;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NzbDrone.Core.Extras;
using NzbDrone.Core.Music;
using NzbDrone.Core.Languages;
namespace NzbDrone.Core.MediaFiles.TrackImport
@ -29,13 +27,11 @@ namespace NzbDrone.Core.MediaFiles.TrackImport
private readonly IExtraService _extraService;
private readonly IDiskProvider _diskProvider;
private readonly IEventAggregator _eventAggregator;
private readonly IAlbumRepository _albumRepository;
private readonly Logger _logger;
public ImportApprovedTracks(IUpgradeMediaFiles episodeFileUpgrader,
IMediaFileService mediaFileService,
IExtraService extraService,
IAlbumRepository albumRepository,
IDiskProvider diskProvider,
IEventAggregator eventAggregator,
Logger logger)
@ -43,7 +39,6 @@ namespace NzbDrone.Core.MediaFiles.TrackImport
_trackFileUpgrader = episodeFileUpgrader;
_mediaFileService = mediaFileService;
_extraService = extraService;
_albumRepository = albumRepository;
_diskProvider = diskProvider;
_eventAggregator = eventAggregator;
_logger = logger;
@ -168,29 +163,5 @@ namespace NzbDrone.Core.MediaFiles.TrackImport
return importResults;
}
//private string GetSceneName(DownloadClientItem downloadClientItem, LocalEpisode localEpisode)
//{
// if (downloadClientItem != null)
// {
// var title = Parser.Parser.RemoveFileExtension(downloadClientItem.Title);
// var parsedTitle = Parser.Parser.ParseTitle(title);
// if (parsedTitle != null && !parsedTitle.FullSeason)
// {
// return title;
// }
// }
// var fileName = Path.GetFileNameWithoutExtension(localEpisode.Path.CleanFilePath());
// if (SceneChecker.IsSceneTitle(fileName))
// {
// return fileName;
// }
// return null;
//}
}
}

@ -1,4 +1,4 @@
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Parser.Model;
using System;
@ -15,8 +15,6 @@ namespace NzbDrone.Core.MediaFiles.TrackImport
public bool Approved => Rejections.Empty();
public object LocalEpisode { get; internal set; }
public ImportDecision(LocalTrack localTrack, params Rejection[] rejections)
{
LocalTrack = localTrack;

@ -172,11 +172,6 @@ namespace NzbDrone.Core.MediaFiles.TrackImport
return false;
}
//if (folderInfo.FullSeason)
//{
// return false;
//}
return musicFiles.Count(file =>
{

@ -6,12 +6,10 @@ using System.Text.RegularExpressions;
using NLog;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Instrumentation;
using NzbDrone.Core.MediaFiles.MediaInfo;
using NzbDrone.Core.Music;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Languages;
using TagLib;
using TagLib.IFD.Tags;
namespace NzbDrone.Core.Parser
{
@ -290,35 +288,9 @@ namespace NzbDrone.Core.Parser
if (result != null)
{
//if (result.FullSeason && title.ContainsIgnoreCase("Special"))
//{
// result.FullSeason = false;
// result.Special = true;
//}
//result.Language = LanguageParser.ParseLanguage(title);
//Logger.Debug("Language parsed: {0}", result.Language);
result.Quality = QualityParser.ParseQuality(title, null, 0);
Logger.Debug("Quality parsed: {0}", result.Quality);
// Majora: We don't currently need Release Group for Music.
//result.ReleaseGroup = ParseReleaseGroup(title);
//var subGroup = GetSubGroup(match);
//if (!subGroup.IsNullOrWhiteSpace())
//{
// result.ReleaseGroup = subGroup;
//}
//Logger.Debug("Release Group parsed: {0}", result.ReleaseGroup);
//result.ReleaseHash = GetReleaseHash(match);
//if (!result.ReleaseHash.IsNullOrWhiteSpace())
//{
// Logger.Debug("Release Hash parsed: {0}", result.ReleaseHash);
//}
return result;
}
}
@ -721,19 +693,6 @@ namespace NzbDrone.Core.Parser
var artistTitleInfo = new ArtistTitleInfo();
artistTitleInfo.Title = title;
//var match = YearInTitleRegex.Match(title);
//if (!match.Success)
//{
// artistTitleInfo.TitleWithoutYear = title;
//}
//else
//{
// artistTitleInfo.TitleWithoutYear = match.Groups["title"].Value;
// artistTitleInfo.Year = Convert.ToInt32(match.Groups["year"].Value);
//}
return artistTitleInfo;
}

@ -38,12 +38,10 @@ namespace NzbDrone.Core.Parser
IArtistService artistService,
IAlbumService albumService,
IMediaFileService mediaFileService,
// ISceneMappingService sceneMappingService,
Logger logger)
{
_albumService = albumService;
_artistService = artistService;
// _sceneMappingService = sceneMappingService;
_trackService = trackService;
_mediaFileService = mediaFileService;
_logger = logger;
@ -298,32 +296,6 @@ namespace NzbDrone.Core.Parser
}
}
//_logger.Debug("Track title search unsuccessful, falling back to track number for {1}", trackInfo, parsedTrackInfo);
//if (parsedTrackInfo.TrackNumbers == null)
//{
// _logger.Debug("Track has no track numbers: {1}", trackInfo, parsedTrackInfo);
// return new List<Track>();
//}
//foreach (var trackNumber in parsedTrackInfo.TrackNumbers)
//{
// Track trackInfoByNumber = null;
// trackInfoByNumber = _trackService.FindTrack(artist.Id, album.Id, parsedTrackInfo.DiscNumber, trackNumber);
// _logger.Debug("Track {0} selected for {1}", trackInfoByNumber, parsedTrackInfo);
// if (trackInfoByNumber != null)
// {
// result.Add(trackInfoByNumber);
// }
// else
// {
// _logger.Debug("Unable to find {0}", parsedTrackInfo);
// }
//}
return result;
}
}

Loading…
Cancel
Save