1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-25 01:02:05 +00:00

Cleanup: Cleanup Import/Parsing Files

This commit is contained in:
Qstick 2018-03-14 22:27:05 -04:00
parent 254b3fcfbe
commit 0f3934454b
5 changed files with 1 additions and 106 deletions

View file

@ -6,13 +6,11 @@
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 @@ public class ImportApprovedTracks : IImportApprovedTracks
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 @@ public ImportApprovedTracks(IUpgradeMediaFiles episodeFileUpgrader,
_trackFileUpgrader = episodeFileUpgrader;
_mediaFileService = mediaFileService;
_extraService = extraService;
_albumRepository = albumRepository;
_diskProvider = diskProvider;
_eventAggregator = eventAggregator;
_logger = logger;
@ -168,29 +163,5 @@ public List<ImportResult> Import(List<ImportDecision> decisions, bool newDownloa
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;
//}
}
}

View file

@ -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 @@ public class ImportDecision
public bool Approved => Rejections.Empty();
public object LocalEpisode { get; internal set; }
public ImportDecision(LocalTrack localTrack, params Rejection[] rejections)
{
LocalTrack = localTrack;

View file

@ -172,11 +172,6 @@ private bool ShouldUseFolderName(List<string> musicFiles, Artist artist, ParsedT
return false;
}
//if (folderInfo.FullSeason)
//{
// return false;
//}
return musicFiles.Count(file =>
{

View file

@ -6,12 +6,10 @@
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 @@ public static ParsedTrackInfo ParseMusicTitle(string title)
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 @@ private static ArtistTitleInfo GetArtistTitleInfo(string title)
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;
}

View file

@ -38,12 +38,10 @@ public ParsingService(ITrackService trackService,
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 @@ private List<Track> GetTracks(Artist artist, ParsedTrackInfo parsedTrackInfo)
}
}
//_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;
}
}