Rename MP3-320 to MP3

pull/1063/head
ta264 3 years ago
parent 3abda061ba
commit 9fb7a1051e

@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using FizzWare.NBuilder;
using FluentAssertions;
@ -43,7 +43,7 @@ namespace NzbDrone.Core.Test.AuthorStatsTests
.With(e => e.Author = _author)
.With(e => e.Edition = _edition)
.With(e => e.EditionId == _edition.Id)
.With(e => e.Quality = new QualityModel(Quality.MP3_320))
.With(e => e.Quality = new QualityModel(Quality.MP3))
.BuildNew();
}

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using Moq;
using NUnit.Framework;
@ -21,7 +21,7 @@ namespace NzbDrone.Core.Test.Blacklisting
{
AuthorId = 12345,
BookIds = new List<int> { 1 },
Quality = new QualityModel(Quality.MP3_320),
Quality = new QualityModel(Quality.MP3),
SourceTitle = "author.name.book.title",
DownloadClient = "SabnzbdClient",
DownloadId = "Sabnzbd_nzo_2dfh73k"

@ -27,7 +27,7 @@ namespace NzbDrone.Core.Test.Datastore
[Test]
public void embedded_document_as_json()
{
var quality = new QualityModel { Quality = Quality.MP3_320, Revision = new Revision(version: 2) };
var quality = new QualityModel { Quality = Quality.MP3, Revision = new Revision(version: 2) };
var history = Builder<History.History>.CreateNew()
.With(c => c.Id = 0)
@ -47,14 +47,14 @@ namespace NzbDrone.Core.Test.Datastore
.All().With(c => c.Id = 0)
.Build().ToList();
history[0].Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2));
history[1].Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2));
history[0].Quality = new QualityModel(Quality.MP3, new Revision(version: 2));
history[1].Quality = new QualityModel(Quality.MP3, new Revision(version: 2));
Db.InsertMany(history);
var returnedHistory = Db.All<History.History>();
returnedHistory[0].Quality.Quality.Should().Be(Quality.MP3_320);
returnedHistory[0].Quality.Quality.Should().Be(Quality.MP3);
}
}
}

@ -23,7 +23,7 @@ namespace NzbDrone.Core.Test.Datastore
var profile = new QualityProfile
{
Name = "Test",
Cutoff = Quality.MP3_320.Id,
Cutoff = Quality.MP3.Id,
Items = Qualities.QualityFixture.GetDefaultQualities()
};

@ -46,7 +46,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
_firstFile = new BookFile { Quality = new QualityModel(Quality.FLAC, new Revision(version: 2)), DateAdded = DateTime.Now };
_mp3 = new QualityModel(Quality.MP3_320, new Revision(version: 1));
_mp3 = new QualityModel(Quality.MP3, new Revision(version: 1));
_flac = new QualityModel(Quality.FLAC, new Revision(version: 1));
_remoteBook = new RemoteBook

@ -19,7 +19,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Subject.CutoffNotMet(
new QualityProfile
{
Cutoff = Quality.MP3_320.Id,
Cutoff = Quality.MP3.Id,
Items = Qualities.QualityFixture.GetDefaultQualities()
},
new List<QualityModel> { new QualityModel(Quality.Unknown, new Revision(version: 2)) },
@ -32,10 +32,10 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Subject.CutoffNotMet(
new QualityProfile
{
Cutoff = Quality.MP3_320.Id,
Cutoff = Quality.MP3.Id,
Items = Qualities.QualityFixture.GetDefaultQualities()
},
new List<QualityModel> { new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
new List<QualityModel> { new QualityModel(Quality.MP3, new Revision(version: 2)) },
NoPreferredWordScore).Should().BeFalse();
}
@ -48,7 +48,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Cutoff = Quality.AZW3.Id,
Items = Qualities.QualityFixture.GetDefaultQualities()
},
new List<QualityModel> { new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
new List<QualityModel> { new QualityModel(Quality.MP3, new Revision(version: 2)) },
NoPreferredWordScore).Should().BeFalse();
}
@ -58,12 +58,12 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Subject.CutoffNotMet(
new QualityProfile
{
Cutoff = Quality.MP3_320.Id,
Cutoff = Quality.MP3.Id,
Items = Qualities.QualityFixture.GetDefaultQualities()
},
new List<QualityModel> { new QualityModel(Quality.MP3_320, new Revision(version: 1)) },
new List<QualityModel> { new QualityModel(Quality.MP3, new Revision(version: 1)) },
NoPreferredWordScore,
new QualityModel(Quality.MP3_320, new Revision(version: 2))).Should().BeTrue();
new QualityModel(Quality.MP3, new Revision(version: 2))).Should().BeTrue();
}
[Test]
@ -72,10 +72,10 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Subject.CutoffNotMet(
new QualityProfile
{
Cutoff = Quality.MP3_320.Id,
Cutoff = Quality.MP3.Id,
Items = Qualities.QualityFixture.GetDefaultQualities()
},
new List<QualityModel> { new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
new List<QualityModel> { new QualityModel(Quality.MP3, new Revision(version: 2)) },
NoPreferredWordScore,
new QualityModel(Quality.FLAC, new Revision(version: 2))).Should().BeFalse();
}
@ -85,13 +85,13 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
{
QualityProfile profile = new QualityProfile
{
Cutoff = Quality.MP3_320.Id,
Cutoff = Quality.MP3.Id,
Items = Qualities.QualityFixture.GetDefaultQualities(),
};
Subject.CutoffNotMet(
profile,
new List<QualityModel> { new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
new List<QualityModel> { new QualityModel(Quality.MP3, new Revision(version: 2)) },
NoPreferredWordScore,
new QualityModel(Quality.FLAC, new Revision(version: 2)),
10).Should().BeTrue();
@ -102,7 +102,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
{
QualityProfile profile = new QualityProfile
{
Cutoff = Quality.MP3_320.Id,
Cutoff = Quality.MP3.Id,
Items = Qualities.QualityFixture.GetDefaultQualities(),
};

@ -49,7 +49,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(c => c.QualityProfile = new QualityProfile
{
UpgradeAllowed = true,
Cutoff = Quality.MP3_320.Id,
Cutoff = Quality.MP3.Id,
Items = Qualities.QualityFixture.GetDefaultQualities()
})
.Build();
@ -57,19 +57,19 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
_parseResultMulti = new RemoteBook
{
Author = _fakeAuthor,
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3, new Revision(version: 2)) },
Books = doubleBookList
};
_parseResultSingle = new RemoteBook
{
Author = _fakeAuthor,
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3, new Revision(version: 2)) },
Books = singleBookList
};
_upgradableQuality = new QualityModel(Quality.MP3_320, new Revision(version: 1));
_notupgradableQuality = new QualityModel(Quality.MP3_320, new Revision(version: 2));
_upgradableQuality = new QualityModel(Quality.MP3, new Revision(version: 1));
_notupgradableQuality = new QualityModel(Quality.MP3, new Revision(version: 2));
Mocker.GetMock<IConfigService>()
.SetupGet(s => s.EnableCompletedDownloadHandling)
@ -164,9 +164,9 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_not_be_upgradable_if_book_is_of_same_quality_as_existing()
{
_fakeAuthor.QualityProfile = new QualityProfile { Cutoff = Quality.MP3_320.Id, Items = Qualities.QualityFixture.GetDefaultQualities() };
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3_320, new Revision(version: 1));
_upgradableQuality = new QualityModel(Quality.MP3_320, new Revision(version: 1));
_fakeAuthor.QualityProfile = new QualityProfile { Cutoff = Quality.MP3.Id, Items = Qualities.QualityFixture.GetDefaultQualities() };
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3, new Revision(version: 1));
_upgradableQuality = new QualityModel(Quality.MP3, new Revision(version: 1));
GivenMostRecentForBook(FIRST_ALBUM_ID, string.Empty, _upgradableQuality, DateTime.UtcNow, HistoryEventType.Grabbed);
@ -176,9 +176,9 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_not_be_upgradable_if_cutoff_already_met()
{
_fakeAuthor.QualityProfile = new QualityProfile { Cutoff = Quality.MP3_320.Id, Items = Qualities.QualityFixture.GetDefaultQualities() };
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3_320, new Revision(version: 1));
_upgradableQuality = new QualityModel(Quality.MP3_320, new Revision(version: 1));
_fakeAuthor.QualityProfile = new QualityProfile { Cutoff = Quality.MP3.Id, Items = Qualities.QualityFixture.GetDefaultQualities() };
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3, new Revision(version: 1));
_upgradableQuality = new QualityModel(Quality.MP3, new Revision(version: 1));
GivenMostRecentForBook(FIRST_ALBUM_ID, string.Empty, _upgradableQuality, DateTime.UtcNow, HistoryEventType.Grabbed);
@ -204,9 +204,9 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
public void should_return_false_if_cutoff_already_met_and_cdh_is_disabled()
{
GivenCdhDisabled();
_fakeAuthor.QualityProfile = new QualityProfile { Cutoff = Quality.MP3_320.Id, Items = Qualities.QualityFixture.GetDefaultQualities() };
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3_320, new Revision(version: 1));
_upgradableQuality = new QualityModel(Quality.MP3_320, new Revision(version: 1));
_fakeAuthor.QualityProfile = new QualityProfile { Cutoff = Quality.MP3.Id, Items = Qualities.QualityFixture.GetDefaultQualities() };
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3, new Revision(version: 1));
_upgradableQuality = new QualityModel(Quality.MP3, new Revision(version: 1));
GivenMostRecentForBook(FIRST_ALBUM_ID, "test", _upgradableQuality, DateTime.UtcNow.AddDays(-100), HistoryEventType.Grabbed);

@ -73,8 +73,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_put_reals_before_non_reals()
{
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320, new Revision(version: 1, real: 0)));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320, new Revision(version: 1, real: 1)));
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3, new Revision(version: 1, real: 0)));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3, new Revision(version: 1, real: 1)));
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook1));
@ -87,8 +87,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_put_propers_before_non_propers()
{
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320, new Revision(version: 1)));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320, new Revision(version: 2)));
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3, new Revision(version: 1)));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3, new Revision(version: 2)));
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook1));
@ -101,24 +101,24 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_put_higher_quality_before_lower()
{
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook1));
decisions.Add(new DownloadDecision(remoteBook2));
var qualifiedReports = Subject.PrioritizeDecisions(decisions);
qualifiedReports.First().RemoteBook.ParsedBookInfo.Quality.Quality.Should().Be(Quality.MP3_320);
qualifiedReports.First().RemoteBook.ParsedBookInfo.Quality.Quality.Should().Be(Quality.MP3);
}
[Test]
public void should_order_by_age_then_largest_rounded_to_200mb()
{
var remoteBookSd = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), size: 100.Megabytes(), age: 1);
var remoteBookHdSmallOld = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), size: 1200.Megabytes(), age: 1000);
var remoteBookSmallYoung = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), size: 1250.Megabytes(), age: 10);
var remoteBookHdLargeYoung = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), size: 3000.Megabytes(), age: 1);
var remoteBookSd = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), size: 100.Megabytes(), age: 1);
var remoteBookHdSmallOld = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), size: 1200.Megabytes(), age: 1000);
var remoteBookSmallYoung = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), size: 1250.Megabytes(), age: 10);
var remoteBookHdLargeYoung = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), size: 3000.Megabytes(), age: 1);
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBookSd));
@ -133,8 +133,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_order_by_youngest()
{
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), age: 10);
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), age: 5);
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), age: 10);
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), age: 5);
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook1));
@ -147,8 +147,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_not_throw_if_no_books_are_found()
{
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), size: 500.Megabytes());
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), size: 500.Megabytes());
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), size: 500.Megabytes());
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), size: 500.Megabytes());
remoteBook1.Books = new List<Book>();
@ -164,8 +164,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
{
GivenPreferredDownloadProtocol(DownloadProtocol.Usenet);
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), downloadProtocol: DownloadProtocol.Torrent);
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), downloadProtocol: DownloadProtocol.Usenet);
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), downloadProtocol: DownloadProtocol.Torrent);
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), downloadProtocol: DownloadProtocol.Usenet);
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook1));
@ -180,8 +180,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
{
GivenPreferredDownloadProtocol(DownloadProtocol.Torrent);
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), downloadProtocol: DownloadProtocol.Torrent);
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), downloadProtocol: DownloadProtocol.Usenet);
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), downloadProtocol: DownloadProtocol.Torrent);
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), downloadProtocol: DownloadProtocol.Usenet);
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook1));
@ -210,7 +210,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_prefer_quality_over_discography_pack()
{
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1), GivenBook(2) }, new QualityModel(Quality.MP3_320));
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1), GivenBook(2) }, new QualityModel(Quality.MP3));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.FLAC));
remoteBook1.ParsedBookInfo.Discography = true;
@ -226,8 +226,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_prefer_single_book_over_multi_book()
{
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1), GivenBook(2) }, new QualityModel(Quality.MP3_320));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1), GivenBook(2) }, new QualityModel(Quality.MP3));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook1));
@ -240,8 +240,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_prefer_releases_with_more_seeders()
{
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
var torrentInfo1 = new TorrentInfo();
torrentInfo1.PublishDate = DateTime.Now;
@ -266,8 +266,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_prefer_releases_with_more_peers_given_equal_number_of_seeds()
{
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
var torrentInfo1 = new TorrentInfo();
torrentInfo1.PublishDate = DateTime.Now;
@ -293,8 +293,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_prefer_releases_with_more_peers_no_seeds()
{
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
var torrentInfo1 = new TorrentInfo();
torrentInfo1.PublishDate = DateTime.Now;
@ -321,8 +321,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_prefer_first_release_if_peers_and_size_are_too_similar()
{
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
var torrentInfo1 = new TorrentInfo();
torrentInfo1.PublishDate = DateTime.Now;
@ -350,8 +350,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_prefer_first_release_if_age_and_size_are_too_similar()
{
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
remoteBook1.Release.PublishDate = DateTime.UtcNow.AddDays(-100);
remoteBook1.Release.Size = 200.Megabytes();
@ -370,7 +370,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_prefer_quality_over_the_number_of_peers()
{
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.AZW3));
var torrentInfo1 = new TorrentInfo();
@ -399,15 +399,15 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_put_higher_quality_before_lower_always()
{
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook1));
decisions.Add(new DownloadDecision(remoteBook2));
var qualifiedReports = Subject.PrioritizeDecisions(decisions);
qualifiedReports.First().RemoteBook.ParsedBookInfo.Quality.Quality.Should().Be(Quality.MP3_320);
qualifiedReports.First().RemoteBook.ParsedBookInfo.Quality.Quality.Should().Be(Quality.MP3);
}
[Test]

@ -18,9 +18,9 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
public static object[] AllowedTestCases =
{
new object[] { Quality.MP3_320 },
new object[] { Quality.MP3_320 },
new object[] { Quality.MP3_320 }
new object[] { Quality.MP3 },
new object[] { Quality.MP3 },
new object[] { Quality.MP3 }
};
public static object[] DeniedTestCases =
@ -33,13 +33,13 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
public void Setup()
{
var fakeAuthor = Builder<Author>.CreateNew()
.With(c => c.QualityProfile = new QualityProfile { Cutoff = Quality.MP3_320.Id })
.With(c => c.QualityProfile = new QualityProfile { Cutoff = Quality.MP3.Id })
.Build();
_remoteBook = new RemoteBook
{
Author = fakeAuthor,
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3, new Revision(version: 2)) },
};
}
@ -48,7 +48,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
public void should_allow_if_quality_is_defined_in_profile(Quality qualityType)
{
_remoteBook.ParsedBookInfo.Quality.Quality = qualityType;
_remoteBook.Author.QualityProfile.Value.Items = Qualities.QualityFixture.GetDefaultQualities(Quality.MP3_320, Quality.MP3_320, Quality.MP3_320);
_remoteBook.Author.QualityProfile.Value.Items = Qualities.QualityFixture.GetDefaultQualities(Quality.MP3, Quality.MP3, Quality.MP3);
Subject.IsSatisfiedBy(_remoteBook, null).Accepted.Should().BeTrue();
}
@ -58,7 +58,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
public void should_not_allow_if_quality_is_not_defined_in_profile(Quality qualityType)
{
_remoteBook.ParsedBookInfo.Quality.Quality = qualityType;
_remoteBook.Author.QualityProfile.Value.Items = Qualities.QualityFixture.GetDefaultQualities(Quality.MP3_320, Quality.MP3_320, Quality.MP3_320);
_remoteBook.Author.QualityProfile.Value.Items = Qualities.QualityFixture.GetDefaultQualities(Quality.MP3, Quality.MP3, Quality.MP3);
Subject.IsSatisfiedBy(_remoteBook, null).Accepted.Should().BeFalse();
}

@ -58,7 +58,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
_remoteBook = Builder<RemoteBook>.CreateNew()
.With(r => r.Author = _author)
.With(r => r.Books = new List<Book> { _book })
.With(r => r.ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3_320) })
.With(r => r.ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3) })
.With(r => r.PreferredWordScore = 0)
.Build();
}
@ -113,7 +113,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.Books = new List<Book> { _book })
.With(r => r.ParsedBookInfo = new ParsedBookInfo
{
Quality = new QualityModel(Quality.MP3_320)
Quality = new QualityModel(Quality.MP3)
})
.With(r => r.Release = _releaseInfo)
.Build();
@ -126,7 +126,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_return_true_when_quality_in_queue_is_lower()
{
_author.QualityProfile.Value.Cutoff = Quality.MP3_320.Id;
_author.QualityProfile.Value.Cutoff = Quality.MP3.Id;
var remoteBook = Builder<RemoteBook>.CreateNew()
.With(r => r.Author = _author)
@ -150,7 +150,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.Books = new List<Book> { _otherBook })
.With(r => r.ParsedBookInfo = new ParsedBookInfo
{
Quality = new QualityModel(Quality.MP3_320)
Quality = new QualityModel(Quality.MP3)
})
.With(r => r.Release = _releaseInfo)
.Build();
@ -169,7 +169,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.Books = new List<Book> { _book })
.With(r => r.ParsedBookInfo = new ParsedBookInfo
{
Quality = new QualityModel(Quality.MP3_320)
Quality = new QualityModel(Quality.MP3)
})
.With(r => r.Release = _releaseInfo)
.Build();
@ -186,7 +186,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.Books = new List<Book> { _book })
.With(r => r.ParsedBookInfo = new ParsedBookInfo
{
Quality = new QualityModel(Quality.MP3_320)
Quality = new QualityModel(Quality.MP3)
})
.With(r => r.Release = _releaseInfo)
.Build();
@ -205,7 +205,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.Books = new List<Book> { _book })
.With(r => r.ParsedBookInfo = new ParsedBookInfo
{
Quality = new QualityModel(Quality.MP3_320)
Quality = new QualityModel(Quality.MP3)
})
.With(r => r.Release = _releaseInfo)
.Build();
@ -222,7 +222,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.Books = new List<Book> { _book, _otherBook })
.With(r => r.ParsedBookInfo = new ParsedBookInfo
{
Quality = new QualityModel(Quality.MP3_320)
Quality = new QualityModel(Quality.MP3)
})
.With(r => r.Release = _releaseInfo)
.Build();
@ -239,7 +239,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.Books = new List<Book> { _book })
.With(r => r.ParsedBookInfo = new ParsedBookInfo
{
Quality = new QualityModel(Quality.MP3_320)
Quality = new QualityModel(Quality.MP3)
})
.With(r => r.Release = _releaseInfo)
.Build();
@ -258,7 +258,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.Books = new List<Book> { _book, _otherBook })
.With(r => r.ParsedBookInfo = new ParsedBookInfo
{
Quality = new QualityModel(Quality.MP3_320)
Quality = new QualityModel(Quality.MP3)
})
.With(r => r.Release = _releaseInfo)
.Build();
@ -277,7 +277,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.Author = _author)
.With(r => r.ParsedBookInfo = new ParsedBookInfo
{
Quality = new QualityModel(Quality.MP3_320)
Quality = new QualityModel(Quality.MP3)
})
.With(r => r.Release = _releaseInfo)
.TheFirst(1)
@ -321,7 +321,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.Books = new List<Book> { _book })
.With(r => r.ParsedBookInfo = new ParsedBookInfo
{
Quality = new QualityModel(Quality.MP3_320)
Quality = new QualityModel(Quality.MP3)
})
.With(r => r.Release = _releaseInfo)
.Build();

@ -91,7 +91,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
}).ToList();
_trackFiles.Select(c =>
{
c.Quality = new QualityModel(Quality.MP3_320);
c.Quality = new QualityModel(Quality.MP3);
return c;
}).ToList();

@ -48,7 +48,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
_profile.Items = new List<QualityProfileQualityItem>();
_profile.Items.Add(new QualityProfileQualityItem { Allowed = true, Quality = Quality.PDF });
_profile.Items.Add(new QualityProfileQualityItem { Allowed = true, Quality = Quality.AZW3 });
_profile.Items.Add(new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3_320 });
_profile.Items.Add(new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3 });
_profile.Cutoff = Quality.AZW3.Id;
@ -119,7 +119,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
[Test]
public void should_be_true_when_quality_is_last_allowed_in_profile()
{
_remoteBook.ParsedBookInfo.Quality = new QualityModel(Quality.MP3_320);
_remoteBook.ParsedBookInfo.Quality = new QualityModel(Quality.MP3);
Subject.IsSatisfiedBy(_remoteBook, null).Accepted.Should().BeTrue();
}
@ -149,10 +149,10 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
[Test]
public void should_be_true_when_release_is_a_proper_for_existing_book()
{
_remoteBook.ParsedBookInfo.Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2));
_remoteBook.ParsedBookInfo.Quality = new QualityModel(Quality.MP3, new Revision(version: 2));
_remoteBook.Release.PublishDate = DateTime.UtcNow;
GivenExistingFile(new QualityModel(Quality.MP3_320));
GivenExistingFile(new QualityModel(Quality.MP3));
GivenUpgradeForExistingFile();
Mocker.GetMock<IUpgradableSpecification>()
@ -167,10 +167,10 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
[Test]
public void should_be_true_when_release_is_a_real_for_existing_book()
{
_remoteBook.ParsedBookInfo.Quality = new QualityModel(Quality.MP3_320, new Revision(real: 1));
_remoteBook.ParsedBookInfo.Quality = new QualityModel(Quality.MP3, new Revision(real: 1));
_remoteBook.Release.PublishDate = DateTime.UtcNow;
GivenExistingFile(new QualityModel(Quality.MP3_320));
GivenExistingFile(new QualityModel(Quality.MP3));
GivenUpgradeForExistingFile();
Mocker.GetMock<IUpgradableSpecification>()

@ -63,14 +63,14 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
_parseResultMulti = new RemoteBook
{
Author = fakeAuthor,
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3, new Revision(version: 2)) },
Books = doubleBookList
};
_parseResultSingle = new RemoteBook
{
Author = fakeAuthor,
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3, new Revision(version: 2)) },
Books = singleBookList
};

@ -21,7 +21,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
UpgradeAllowed = false
},
new QualityModel(Quality.MP3_320),
new QualityModel(Quality.MP3),
new QualityModel(Quality.FLAC))
.Should().BeFalse();
}
@ -36,7 +36,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
UpgradeAllowed = true
},
new QualityModel(Quality.MP3_320),
new QualityModel(Quality.MP3),
new QualityModel(Quality.FLAC))
.Should().BeTrue();
}
@ -51,8 +51,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
UpgradeAllowed = true
},
new QualityModel(Quality.MP3_320),
new QualityModel(Quality.MP3_320))
new QualityModel(Quality.MP3),
new QualityModel(Quality.MP3))
.Should().BeTrue();
}
@ -66,8 +66,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
UpgradeAllowed = false
},
new QualityModel(Quality.MP3_320),
new QualityModel(Quality.MP3_320))
new QualityModel(Quality.MP3),
new QualityModel(Quality.MP3))
.Should().BeTrue();
}
@ -81,8 +81,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
UpgradeAllowed = true
},
new QualityModel(Quality.MP3_320),
new QualityModel(Quality.MP3_320))
new QualityModel(Quality.MP3),
new QualityModel(Quality.MP3))
.Should().BeTrue();
}
@ -96,8 +96,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
UpgradeAllowed = false
},
new QualityModel(Quality.MP3_320),
new QualityModel(Quality.MP3_320))
new QualityModel(Quality.MP3),
new QualityModel(Quality.MP3))
.Should().BeTrue();
}
}

@ -39,7 +39,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(c => c.QualityProfile = new QualityProfile
{
UpgradeAllowed = true,
Cutoff = Quality.MP3_320.Id,
Cutoff = Quality.MP3.Id,
Items = Qualities.QualityFixture.GetDefaultQualities()
})
.Build();
@ -51,26 +51,26 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
_parseResultMulti = new RemoteBook
{
Author = fakeAuthor,
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3, new Revision(version: 2)) },
Books = doubleBookList
};
_parseResultSingle = new RemoteBook
{
Author = fakeAuthor,
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3, new Revision(version: 2)) },
Books = singleBookList
};
}
private void WithFirstFileUpgradable()
{
_firstFile.Quality = new QualityModel(Quality.MP3_320);
_firstFile.Quality = new QualityModel(Quality.MP3);
}
private void WithSecondFileUpgradable()
{
_secondFile.Quality = new QualityModel(Quality.MP3_320);
_secondFile.Quality = new QualityModel(Quality.MP3);
}
[Test]
@ -113,9 +113,9 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_not_be_upgradable_if_qualities_are_the_same()
{
_firstFile.Quality = new QualityModel(Quality.MP3_320);
_secondFile.Quality = new QualityModel(Quality.MP3_320);
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3_320);
_firstFile.Quality = new QualityModel(Quality.MP3);
_secondFile.Quality = new QualityModel(Quality.MP3);
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3);
Subject.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeFalse();
}
@ -137,7 +137,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
public void should_be_false_if_some_tracks_are_upgradable_and_some_are_downgrades()
{
WithFirstFileUpgradable();
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3_320);
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3);
Subject.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeFalse();
}
}

@ -16,11 +16,11 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
public static object[] IsUpgradeTestCases =
{
new object[] { Quality.AZW3, 1, Quality.AZW3, 2, Quality.AZW3, true },
new object[] { Quality.MP3_320, 1, Quality.MP3_320, 2, Quality.MP3_320, true },
new object[] { Quality.MP3_320, 1, Quality.MP3_320, 1, Quality.MP3_320, false },
new object[] { Quality.MP3_320, 1, Quality.AZW3, 2, Quality.MP3_320, false },
new object[] { Quality.MP3_320, 1, Quality.AZW3, 2, Quality.MP3_320, false },
new object[] { Quality.MP3_320, 1, Quality.MP3_320, 1, Quality.MP3_320, false }
new object[] { Quality.MP3, 1, Quality.MP3, 2, Quality.MP3, true },
new object[] { Quality.MP3, 1, Quality.MP3, 1, Quality.MP3, false },
new object[] { Quality.MP3, 1, Quality.AZW3, 2, Quality.MP3, false },
new object[] { Quality.MP3, 1, Quality.AZW3, 2, Quality.MP3, false },
new object[] { Quality.MP3, 1, Quality.MP3, 1, Quality.MP3, false }
};
private static readonly int NoPreferredWordScore = 0;
@ -65,9 +65,9 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Subject.IsUpgradable(
profile,
new QualityModel(Quality.MP3_320, new Revision(version: 1)),
new QualityModel(Quality.MP3, new Revision(version: 1)),
NoPreferredWordScore,
new QualityModel(Quality.MP3_320, new Revision(version: 2)),
new QualityModel(Quality.MP3, new Revision(version: 2)),
NoPreferredWordScore)
.Should().BeTrue();
}
@ -84,9 +84,9 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Subject.IsUpgradable(
profile,
new QualityModel(Quality.MP3_320, new Revision(version: 1)),
new QualityModel(Quality.MP3, new Revision(version: 1)),
NoPreferredWordScore,
new QualityModel(Quality.MP3_320, new Revision(version: 2)),
new QualityModel(Quality.MP3, new Revision(version: 2)),
NoPreferredWordScore)
.Should().BeFalse();
}

@ -61,7 +61,7 @@ namespace NzbDrone.Core.Test.Download.DownloadApprovedReportsTests
public void should_download_report_if_book_was_not_already_downloaded()
{
var books = new List<Book> { GetBook(1) };
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3_320));
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3));
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook));
@ -74,7 +74,7 @@ namespace NzbDrone.Core.Test.Download.DownloadApprovedReportsTests
public void should_only_download_book_once()
{
var books = new List<Book> { GetBook(1) };
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3_320));
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3));
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook));
@ -89,11 +89,11 @@ namespace NzbDrone.Core.Test.Download.DownloadApprovedReportsTests
{
var remoteBook1 = GetRemoteBook(
new List<Book> { GetBook(1) },
new QualityModel(Quality.MP3_320));
new QualityModel(Quality.MP3));
var remoteBook2 = GetRemoteBook(
new List<Book> { GetBook(1), GetBook(2) },
new QualityModel(Quality.MP3_320));
new QualityModel(Quality.MP3));
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook1));
@ -107,7 +107,7 @@ namespace NzbDrone.Core.Test.Download.DownloadApprovedReportsTests
public void should_return_downloaded_reports()
{
var books = new List<Book> { GetBook(1) };
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3_320));
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3));
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook));
@ -120,11 +120,11 @@ namespace NzbDrone.Core.Test.Download.DownloadApprovedReportsTests
{
var remoteBook1 = GetRemoteBook(
new List<Book> { GetBook(1) },
new QualityModel(Quality.MP3_320));
new QualityModel(Quality.MP3));
var remoteBook2 = GetRemoteBook(
new List<Book> { GetBook(2) },
new QualityModel(Quality.MP3_320));
new QualityModel(Quality.MP3));
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook1));
@ -138,15 +138,15 @@ namespace NzbDrone.Core.Test.Download.DownloadApprovedReportsTests
{
var remoteBook1 = GetRemoteBook(
new List<Book> { GetBook(1) },
new QualityModel(Quality.MP3_320));
new QualityModel(Quality.MP3));
var remoteBook2 = GetRemoteBook(
new List<Book> { GetBook(2) },
new QualityModel(Quality.MP3_320));
new QualityModel(Quality.MP3));
var remoteBook3 = GetRemoteBook(
new List<Book> { GetBook(2) },
new QualityModel(Quality.MP3_320));
new QualityModel(Quality.MP3));
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook1));
@ -160,7 +160,7 @@ namespace NzbDrone.Core.Test.Download.DownloadApprovedReportsTests
public void should_not_add_to_downloaded_list_when_download_fails()
{
var books = new List<Book> { GetBook(1) };
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3_320));
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3));
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook));
@ -184,7 +184,7 @@ namespace NzbDrone.Core.Test.Download.DownloadApprovedReportsTests
public void should_not_grab_if_pending()
{
var books = new List<Book> { GetBook(1) };
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3_320));
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3));
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook, new Rejection("Failure!", RejectionType.Temporary)));
@ -197,7 +197,7 @@ namespace NzbDrone.Core.Test.Download.DownloadApprovedReportsTests
public void should_not_add_to_pending_if_book_was_grabbed()
{
var books = new List<Book> { GetBook(1) };
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3_320));
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3));
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook));
@ -211,7 +211,7 @@ namespace NzbDrone.Core.Test.Download.DownloadApprovedReportsTests
public void should_add_to_pending_even_if_already_added_to_pending()
{
var books = new List<Book> { GetBook(1) };
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3_320));
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3));
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook, new Rejection("Failure!", RejectionType.Temporary)));
@ -225,7 +225,7 @@ namespace NzbDrone.Core.Test.Download.DownloadApprovedReportsTests
public void should_add_to_failed_if_already_failed_for_that_protocol()
{
var books = new List<Book> { GetBook(1) };
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3_320));
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3));
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook));
@ -242,8 +242,8 @@ namespace NzbDrone.Core.Test.Download.DownloadApprovedReportsTests
public void should_not_add_to_failed_if_failed_for_a_different_protocol()
{
var books = new List<Book> { GetBook(1) };
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3_320), DownloadProtocol.Usenet);
var remoteBook2 = GetRemoteBook(books, new QualityModel(Quality.MP3_320), DownloadProtocol.Torrent);
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3), DownloadProtocol.Usenet);
var remoteBook2 = GetRemoteBook(books, new QualityModel(Quality.MP3), DownloadProtocol.Torrent);
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook));
@ -261,7 +261,7 @@ namespace NzbDrone.Core.Test.Download.DownloadApprovedReportsTests
public void should_add_to_rejected_if_release_unavailable_on_indexer()
{
var books = new List<Book> { GetBook(1) };
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3_320));
var remoteBook = GetRemoteBook(books, new QualityModel(Quality.MP3));
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteBook));

@ -41,12 +41,12 @@ namespace NzbDrone.Core.Test.Download.Pending.PendingReleaseServiceTests
_profile = new QualityProfile
{
Name = "Test",
Cutoff = Quality.MP3_320.Id,
Cutoff = Quality.MP3.Id,
Items = new List<QualityProfileQualityItem>
{
new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3_320 },
new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3_320 },
new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3_320 }
new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3 },
new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3 },
new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3 }
},
};
@ -55,7 +55,7 @@ namespace NzbDrone.Core.Test.Download.Pending.PendingReleaseServiceTests
_release = Builder<ReleaseInfo>.CreateNew().Build();
_parsedBookInfo = Builder<ParsedBookInfo>.CreateNew().Build();
_parsedBookInfo.Quality = new QualityModel(Quality.MP3_320);
_parsedBookInfo.Quality = new QualityModel(Quality.MP3);
_remoteBook = new RemoteBook();
_remoteBook.Books = new List<Book> { _book };

@ -41,11 +41,11 @@ namespace NzbDrone.Core.Test.Download.Pending.PendingReleaseServiceTests
_profile = new QualityProfile
{
Name = "Test",
Cutoff = Quality.MP3_320.Id,
Cutoff = Quality.MP3.Id,
Items = new List<QualityProfileQualityItem>
{
new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3_320 },
new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3_320 },
new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3 },
new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3 },
new QualityProfileQualityItem { Allowed = true, Quality = Quality.FLAC }
},
};
@ -55,7 +55,7 @@ namespace NzbDrone.Core.Test.Download.Pending.PendingReleaseServiceTests
_release = Builder<ReleaseInfo>.CreateNew().Build();
_parsedBookInfo = Builder<ParsedBookInfo>.CreateNew().Build();
_parsedBookInfo.Quality = new QualityModel(Quality.MP3_320);
_parsedBookInfo.Quality = new QualityModel(Quality.MP3);
_remoteBook = new RemoteBook();
_remoteBook.Books = new List<Book> { _book };
@ -120,7 +120,7 @@ namespace NzbDrone.Core.Test.Download.Pending.PendingReleaseServiceTests
[Test]
public void should_delete_if_the_grabbed_quality_is_the_higher()
{
GivenHeldRelease(new QualityModel(Quality.MP3_320));
GivenHeldRelease(new QualityModel(Quality.MP3));
Subject.Handle(new BookGrabbedEvent(_remoteBook));

@ -41,12 +41,12 @@ namespace NzbDrone.Core.Test.Download.Pending.PendingReleaseServiceTests
_profile = new QualityProfile
{
Name = "Test",
Cutoff = Quality.MP3_320.Id,
Cutoff = Quality.MP3.Id,
Items = new List<QualityProfileQualityItem>
{
new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3_320 },
new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3_320 },
new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3_320 }
new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3 },
new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3 },
new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3 }
},
};
@ -55,7 +55,7 @@ namespace NzbDrone.Core.Test.Download.Pending.PendingReleaseServiceTests
_release = Builder<ReleaseInfo>.CreateNew().Build();
_parsedBookInfo = Builder<ParsedBookInfo>.CreateNew().Build();
_parsedBookInfo.Quality = new QualityModel(Quality.MP3_320);
_parsedBookInfo.Quality = new QualityModel(Quality.MP3);
_remoteBook = new RemoteBook();
_remoteBook.Books = new List<Book> { _book };

@ -1,4 +1,4 @@
using FizzWare.NBuilder;
using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.History;
@ -29,7 +29,7 @@ namespace NzbDrone.Core.Test.HistoryTests
public void should_get_download_history()
{
var historyBluray = Builder<History.History>.CreateNew()
.With(c => c.Quality = new QualityModel(Quality.MP3_320))
.With(c => c.Quality = new QualityModel(Quality.MP3))
.With(c => c.AuthorId = 12)
.With(c => c.EventType = HistoryEventType.Grabbed)
.BuildNew();
@ -43,7 +43,7 @@ namespace NzbDrone.Core.Test.HistoryTests
Subject.Insert(historyBluray);
Subject.Insert(historyDvd);
var downloadHistory = Subject.FindDownloadHistory(12, new QualityModel(Quality.MP3_320));
var downloadHistory = Subject.FindDownloadHistory(12, new QualityModel(Quality.MP3));
downloadHistory.Should().HaveCount(1);
}

@ -28,14 +28,14 @@ namespace NzbDrone.Core.Test.HistoryTests
{
_profile = new QualityProfile
{
Cutoff = Quality.MP3_320.Id,
Cutoff = Quality.MP3.Id,
Items = QualityFixture.GetDefaultQualities(),
};
_profileCustom = new QualityProfile
{
Cutoff = Quality.MP3_320.Id,
Items = QualityFixture.GetDefaultQualities(Quality.MP3_320),
Cutoff = Quality.MP3.Id,
Items = QualityFixture.GetDefaultQualities(Quality.MP3),
};
}

@ -64,7 +64,7 @@ namespace NzbDrone.Core.Test.MediaFiles
Book = book,
Edition = edition,
Path = Path.Combine(author.Path, "Alien Ant Farm - 01 - Pilot.mp3"),
Quality = new QualityModel(Quality.MP3_320),
Quality = new QualityModel(Quality.MP3),
FileTrackInfo = new ParsedTrackInfo
{
ReleaseGroup = "DRONE"
@ -170,7 +170,7 @@ namespace NzbDrone.Core.Test.MediaFiles
Book = fileDecision.Item.Book,
Edition = fileDecision.Item.Edition,
Path = @"C:\Test\Music\Alien Ant Farm\Alien Ant Farm - 01 - Pilot.mp3".AsOsAgnostic(),
Quality = new QualityModel(Quality.MP3_320),
Quality = new QualityModel(Quality.MP3),
Size = 80.Megabytes()
});

@ -47,7 +47,7 @@ namespace NzbDrone.Core.Test.MediaFiles
var files = Builder<BookFile>.CreateListOfSize(10)
.All()
.With(c => c.Id = 0)
.With(c => c.Quality = new QualityModel(Quality.MP3_320))
.With(c => c.Quality = new QualityModel(Quality.MP3))
.TheFirst(5)
.With(c => c.EditionId = _edition.Id)
.TheRest()
@ -99,7 +99,7 @@ namespace NzbDrone.Core.Test.MediaFiles
var files = Builder<BookFile>.CreateListOfSize(2)
.All()
.With(c => c.Id = 0)
.With(c => c.Quality = new QualityModel(Quality.MP3_320))
.With(c => c.Quality = new QualityModel(Quality.MP3))
.TheFirst(1)
.With(c => c.Path = @"C:\Test\Path2\Author\somefile1.flac".AsOsAgnostic())
.TheNext(1)

@ -98,7 +98,7 @@ namespace NzbDrone.Core.Test.MediaFiles.BookImport
.With(x => x.Book = _book)
.Build();
_quality = new QualityModel(Quality.MP3_320);
_quality = new QualityModel(Quality.MP3);
_localTrack = new LocalBook
{

@ -36,7 +36,7 @@ namespace NzbDrone.Core.Test.MediaFiles.BookImport.Specifications
_localTrack = new LocalTrack
{
Path = @"C:\Test\Imagine Dragons\Imagine.Dragons.Song.1.mp3",
Quality = new QualityModel(Quality.MP3_320, new Revision(version: 1)),
Quality = new QualityModel(Quality.MP3, new Revision(version: 1)),
Author = _author,
Book = _book
};
@ -77,7 +77,7 @@ namespace NzbDrone.Core.Test.MediaFiles.BookImport.Specifications
.With(e => e.TrackFile = new LazyLoaded<TrackFile>(
new TrackFile
{
Quality = new QualityModel(Quality.MP3_320, new Revision(version: 1))
Quality = new QualityModel(Quality.MP3, new Revision(version: 1))
}))
.Build()
.ToList();
@ -94,7 +94,7 @@ namespace NzbDrone.Core.Test.MediaFiles.BookImport.Specifications
.With(e => e.TrackFile = new LazyLoaded<TrackFile>(
new TrackFile
{
Quality = new QualityModel(Quality.MP3_320, new Revision(version: 1))
Quality = new QualityModel(Quality.MP3, new Revision(version: 1))
}))
.Build()
.ToList();
@ -145,7 +145,7 @@ namespace NzbDrone.Core.Test.MediaFiles.BookImport.Specifications
.With(e => e.TrackFile = new LazyLoaded<TrackFile>(
new TrackFile
{
Quality = new QualityModel(Quality.MP3_320, new Revision(version: 1))
Quality = new QualityModel(Quality.MP3, new Revision(version: 1))
}))
.TheNext(1)
.With(e => e.TrackFileId = 2)
@ -173,7 +173,7 @@ namespace NzbDrone.Core.Test.MediaFiles.BookImport.Specifications
.With(e => e.TrackFile = new LazyLoaded<TrackFile>(
new TrackFile
{
Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2))
Quality = new QualityModel(Quality.MP3, new Revision(version: 2))
}))
.Build()
.ToList();
@ -194,7 +194,7 @@ namespace NzbDrone.Core.Test.MediaFiles.BookImport.Specifications
.With(e => e.TrackFile = new LazyLoaded<TrackFile>(
new TrackFile
{
Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2))
Quality = new QualityModel(Quality.MP3, new Revision(version: 2))
}))
.Build()
.ToList();

@ -63,7 +63,7 @@ namespace NzbDrone.Core.Test.MusicTests.AuthorRepositoryTests
{
var profile = new QualityProfile
{
Items = Qualities.QualityFixture.GetDefaultQualities(Quality.FLAC, Quality.MP3_320, Quality.MP3_320),
Items = Qualities.QualityFixture.GetDefaultQualities(Quality.FLAC, Quality.MP3, Quality.MP3),
Cutoff = Quality.FLAC.Id,
Name = "TestProfile"

@ -39,7 +39,7 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
.With(s => s.Book = _book)
.Build();
_trackFile = new BookFile { Quality = new QualityModel(Quality.MP3_320), ReleaseGroup = "ReadarrTest" };
_trackFile = new BookFile { Quality = new QualityModel(Quality.MP3), ReleaseGroup = "ReadarrTest" };
_namingConfig = NamingConfig.Default;
_namingConfig.RenameBooks = true;

@ -56,7 +56,7 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
_trackFile = Builder<BookFile>.CreateNew()
.With(e => e.Part = 1)
.With(e => e.PartCount = 1)
.With(e => e.Quality = new QualityModel(Quality.MP3_320))
.With(e => e.Quality = new QualityModel(Quality.MP3))
.With(e => e.ReleaseGroup = "ReadarrTest")
.With(e => e.MediaInfo = new Parser.Model.MediaInfoModel
{
@ -252,7 +252,7 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
_namingConfig.StandardBookFormat = "{Quality Title}";
Subject.BuildBookFileName(_author, _edition, _trackFile)
.Should().Be("MP3-320");
.Should().Be("MP3");
}
[Test]
@ -306,7 +306,7 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
_namingConfig.StandardBookFormat = "{Author Name} - {Book Title} - [{Quality Title}]";
Subject.BuildBookFileName(_author, _edition, _trackFile)
.Should().Be("Linkin Park - Hybrid Theory - [MP3-320]");
.Should().Be("Linkin Park - Hybrid Theory - [MP3]");
}
[Test]
@ -386,7 +386,7 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
_namingConfig.StandardBookFormat = "{Author.Name}{_Book.Title_}{Quality.Title}";
Subject.BuildBookFileName(_author, _edition, _trackFile)
.Should().Be("Linkin.Park_Hybrid.Theory_MP3-320");
.Should().Be("Linkin.Park_Hybrid.Theory_MP3");
}
[Test]
@ -440,7 +440,7 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
_namingConfig.StandardBookFormat = "{Quality Title} {Quality Proper}";
Subject.BuildBookFileName(_author, _edition, _trackFile)
.Should().Be("MP3-320");
.Should().Be("MP3");
}
[Test]
@ -449,7 +449,7 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
_namingConfig.StandardBookFormat = "{Author Name} - {Book Title} [{Quality Title}] {[Quality Proper]}";
Subject.BuildBookFileName(_author, _edition, _trackFile)
.Should().Be("Linkin Park - Hybrid Theory [MP3-320]");
.Should().Be("Linkin Park - Hybrid Theory [MP3]");
}
[Test]
@ -458,7 +458,7 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
_namingConfig.StandardBookFormat = "{Author Name} - {Book Title} [{Quality Full}]";
Subject.BuildBookFileName(_author, _edition, _trackFile)
.Should().Be("Linkin Park - Hybrid Theory [MP3-320]");
.Should().Be("Linkin Park - Hybrid Theory [MP3]");
}
[TestCase(' ')]
@ -470,7 +470,7 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
_namingConfig.StandardBookFormat = string.Format("{{Quality{0}Title}}{0}{{Quality{0}Proper}}", separator);
Subject.BuildBookFileName(_author, _edition, _trackFile)
.Should().Be("MP3-320");
.Should().Be("MP3");
}
[TestCase(' ')]
@ -482,7 +482,7 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
_namingConfig.StandardBookFormat = string.Format("{{Quality{0}Title}}{0}{{Quality{0}Proper}}{0}{{Book{0}Title}}", separator);
Subject.BuildBookFileName(_author, _edition, _trackFile)
.Should().Be(string.Format("MP3-320{0}Hybrid{0}Theory", separator));
.Should().Be(string.Format("MP3{0}Hybrid{0}Theory", separator));
}
[Test]

@ -39,7 +39,7 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
.With(s => s.Book = _book)
.Build();
_trackFile = new BookFile { Quality = new QualityModel(Quality.MP3_320), ReleaseGroup = "ReadarrTest" };
_trackFile = new BookFile { Quality = new QualityModel(Quality.MP3), ReleaseGroup = "ReadarrTest" };
_namingConfig = NamingConfig.Default;
_namingConfig.RenameBooks = true;

@ -15,70 +15,70 @@ namespace NzbDrone.Core.Test.ParserTests
{
@"C:\Test\Some.Hashed.Release.(256kbps)-Mercury\0e895c37245186812cb08aab1529cf8ee389dd05.mp3".AsOsAgnostic(),
"Some Hashed Release",
Quality.MP3_320,
Quality.MP3,
"Mercury"
},
new object[]
{
@"C:\Test-[256]\0e895c37245186812cb08aab1529cf8ee389dd05\Some.Hashed.Release.S01E01.720p.WEB-DL.AAC2.0.H.264-Mercury.mp3".AsOsAgnostic(),
"Some Hashed Release",
Quality.MP3_320,
Quality.MP3,
"Mercury"
},
new object[]
{
@"C:\Test\Fake.Dir.S01E01-Test\yrucreM-462.H.0.2CAA.LD-BEW.p027.10E10S.esaeleR.dehsaH.emoS.mp3".AsOsAgnostic(),
"Some Hashed Release",
Quality.MP3_320,
Quality.MP3,
"Mercury"
},
new object[]
{
@"C:\Test\Fake.Dir.S01E01-Test\yrucreM-LN 1.5DD LD-BEW P0801 10E10S esaeleR dehsaH emoS.mp3".AsOsAgnostic(),
"Some Hashed Release",
Quality.MP3_320,
Quality.MP3,
"Mercury"
},
new object[]
{
@"C:\Test\Weeds.S01E10.DVDRip.XviD-Readarr\AHFMZXGHEWD660.mp3".AsOsAgnostic(),
"Weeds",
Quality.MP3_320,
Quality.MP3,
"Readarr"
},
new object[]
{
@"C:\Test\Deadwood.S02E12.1080p.BluRay.x264-Readarr\Backup_72023S02-12.mp3".AsOsAgnostic(),
"Deadwood",
Quality.MP3_320,
Quality.MP3,
null
},
new object[]
{
@"C:\Test\Grimm S04E08 Chupacabra 720p WEB-DL DD5 1 H 264-ECI\123.mp3".AsOsAgnostic(),
"Grimm",
Quality.MP3_320,
Quality.MP3,
"ECI"
},
new object[]
{
@"C:\Test\Grimm S04E08 Chupacabra 720p WEB-DL DD5 1 H 264-ECI\abc.mp3".AsOsAgnostic(),
"Grimm",
Quality.MP3_320,
Quality.MP3,
"ECI"
},
new object[]
{
@"C:\Test\Grimm S04E08 Chupacabra 720p WEB-DL DD5 1 H 264-ECI\b00bs.mp3".AsOsAgnostic(),
"Grimm",
Quality.MP3_320,
Quality.MP3,
"ECI"
},
new object[]
{
@"C:\Test\The.Good.Wife.S02E23.720p.HDTV.x264-NZBgeek/cgajsofuejsa501.mp3".AsOsAgnostic(),
"The Good Wife",
Quality.MP3_320,
Quality.MP3,
"NZBgeek"
}
};

@ -12,7 +12,7 @@ namespace NzbDrone.Core.Test.ParserTests
{
public static object[] SelfQualityParserCases =
{
new object[] { Quality.MP3_320 },
new object[] { Quality.MP3 },
new object[] { Quality.FLAC },
new object[] { Quality.EPUB },
new object[] { Quality.MOBI },
@ -39,7 +39,7 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Maroon 5 Ft Kendrick Lamar -Dont Wanna Know MP3 2016")]
public void should_parse_mp3_quality(string title)
{
ParseAndVerifyQuality(title, null, 0, Quality.MP3_320);
ParseAndVerifyQuality(title, null, 0, Quality.MP3);
}
[TestCase("Kendrick Lamar - DAMN (2017) FLAC")]

@ -14,8 +14,8 @@ namespace NzbDrone.Core.Test.Profiles
{
var profile = new QualityProfile
{
Items = Qualities.QualityFixture.GetDefaultQualities(Quality.MP3_320, Quality.MP3_320, Quality.MP3_320),
Cutoff = Quality.MP3_320.Id,
Items = Qualities.QualityFixture.GetDefaultQualities(Quality.MP3, Quality.MP3, Quality.MP3),
Cutoff = Quality.MP3.Id,
Name = "TestProfile"
};

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Moq;
using NUnit.Framework;
using NzbDrone.Core.Lifecycle;
@ -26,7 +26,7 @@ namespace NzbDrone.Core.Test.Qualities
.Setup(s => s.All())
.Returns(new List<QualityDefinition>
{
new QualityDefinition(Quality.MP3_320) { Weight = 1, MinSize = 0, MaxSize = 100, Id = 20 }
new QualityDefinition(Quality.MP3) { Weight = 1, MinSize = 0, MaxSize = 100, Id = 20 }
});
Subject.Handle(new ApplicationStartedEvent());
@ -42,7 +42,7 @@ namespace NzbDrone.Core.Test.Qualities
.Setup(s => s.All())
.Returns(new List<QualityDefinition>
{
new QualityDefinition(Quality.MP3_320) { Weight = 1, MinSize = 0, MaxSize = 100, Id = 20 }
new QualityDefinition(Quality.MP3) { Weight = 1, MinSize = 0, MaxSize = 100, Id = 20 }
});
Subject.Handle(new ApplicationStartedEvent());

@ -18,7 +18,7 @@ namespace NzbDrone.Core.Test.Qualities
new object[] { 2, Quality.MOBI },
new object[] { 3, Quality.EPUB },
new object[] { 4, Quality.AZW3 },
new object[] { 10, Quality.MP3_320 },
new object[] { 10, Quality.MP3 },
new object[] { 11, Quality.FLAC },
};
@ -29,7 +29,7 @@ namespace NzbDrone.Core.Test.Qualities
new object[] { Quality.MOBI, 2 },
new object[] { Quality.EPUB, 3 },
new object[] { Quality.AZW3, 4 },
new object[] { Quality.MP3_320, 10 },
new object[] { Quality.MP3, 10 },
new object[] { Quality.FLAC, 11 },
};
@ -57,7 +57,7 @@ namespace NzbDrone.Core.Test.Qualities
Quality.MOBI,
Quality.EPUB,
Quality.AZW3,
Quality.MP3_320,
Quality.MP3,
Quality.FLAC
};

@ -28,17 +28,17 @@ namespace NzbDrone.Core.MediaFiles
{ ".wavpack", Quality.FLAC },
{ ".wav", Quality.FLAC },
{ ".alac", Quality.FLAC },
{ ".mp2", Quality.MP3_320 },
{ ".mp3", Quality.MP3_320 },
{ ".wma", Quality.MP3_320 },
{ ".m4a", Quality.MP3_320 },
{ ".m4p", Quality.MP3_320 },
{ ".mp2", Quality.MP3 },
{ ".mp3", Quality.MP3 },
{ ".wma", Quality.MP3 },
{ ".m4a", Quality.MP3 },
{ ".m4p", Quality.MP3 },
{ ".m4b", Quality.M4B },
{ ".aac", Quality.MP3_320 },
{ ".mp4a", Quality.MP3_320 },
{ ".ogg", Quality.MP3_320 },
{ ".oga", Quality.MP3_320 },
{ ".vorbis", Quality.MP3_320 },
{ ".aac", Quality.MP3 },
{ ".mp4a", Quality.MP3 },
{ ".ogg", Quality.MP3 },
{ ".oga", Quality.MP3 },
{ ".vorbis", Quality.MP3 },
};
}

@ -61,7 +61,7 @@ namespace NzbDrone.Core.Organizer
_singleTrackFile = new BookFile
{
Quality = new QualityModel(Quality.MP3_320, new Revision(2)),
Quality = new QualityModel(Quality.MP3, new Revision(2)),
Path = "/music/Author.Name.Book.Name.TrackNum.Track.Title.MP3256.mp3",
SceneName = "Author.Name.Book.Name.TrackNum.Track.Title.MP3256",
ReleaseGroup = "RlsGrp",

@ -86,7 +86,7 @@ namespace NzbDrone.Core.Parser
case Codec.AACVBR:
case Codec.OGG:
case Codec.OPUS:
result.Quality = Quality.MP3_320;
result.Quality = Quality.MP3;
break;
case Codec.Unknown:
default:
@ -236,7 +236,7 @@ namespace NzbDrone.Core.Parser
case Codec.AAC:
return Quality.M4B;
default:
return Quality.MP3_320;
return Quality.MP3;
}
}

@ -97,14 +97,14 @@ namespace NzbDrone.Core.Profiles.Qualities
Quality.EPUB,
Quality.AZW3,
Quality.UnknownAudio,
Quality.MP3_320,
Quality.MP3,
Quality.M4B,
Quality.FLAC);
AddDefaultProfile("Audio",
Quality.MP3_320,
Quality.MP3,
Quality.UnknownAudio,
Quality.MP3_320,
Quality.MP3,
Quality.M4B,
Quality.FLAC);

@ -75,7 +75,7 @@ namespace NzbDrone.Core.Qualities
public static Quality MOBI => new Quality(2, "MOBI");
public static Quality EPUB => new Quality(3, "EPUB");
public static Quality AZW3 => new Quality(4, "AZW3");
public static Quality MP3_320 => new Quality(10, "MP3-320");
public static Quality MP3 => new Quality(10, "MP3");
public static Quality FLAC => new Quality(11, "FLAC");
public static Quality M4B => new Quality(12, "M4B");
public static Quality UnknownAudio => new Quality(13, "Unknown Audio");
@ -90,7 +90,7 @@ namespace NzbDrone.Core.Qualities
EPUB,
AZW3,
UnknownAudio,
MP3_320,
MP3,
M4B,
FLAC
};
@ -109,7 +109,7 @@ namespace NzbDrone.Core.Qualities
new QualityDefinition(Quality.EPUB) { Weight = 11, MinSize = 0, MaxSize = 350, GroupWeight = 11 },
new QualityDefinition(Quality.AZW3) { Weight = 12, MinSize = 0, MaxSize = 350, GroupWeight = 12 },
new QualityDefinition(Quality.UnknownAudio) { Weight = 50, MinSize = 0, MaxSize = 350, GroupWeight = 50 },
new QualityDefinition(Quality.MP3_320) { Weight = 100, MinSize = 0, MaxSize = 350, GroupWeight = 100 },
new QualityDefinition(Quality.MP3) { Weight = 100, MinSize = 0, MaxSize = 350, GroupWeight = 100 },
new QualityDefinition(Quality.M4B) { Weight = 105, MinSize = 0, MaxSize = 350, GroupWeight = 105 },
new QualityDefinition(Quality.FLAC) { Weight = 110, MinSize = 0, MaxSize = null, GroupWeight = 110 },
};

Loading…
Cancel
Save