Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Show release details for failed and ignored history events
- Show when a release was previously grabbed or failed in Radarr's interactive search
- Show when a release was previously grabbed or failed in Sonarr v5's interactive search
- Filter Sonarr v5 releases by multi-season pack

### Fixed
- Open the exact movie on Letterboxd instead of a search
Expand Down
6 changes: 6 additions & 0 deletions Ruddarr/Models/Series/SeriesRelease.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ struct SeriesRelease: Identifiable, Codable {
let episodeIds: [Series.ID]?

let seasonNumber: Season.ID
let seasonNumbers: [Season.ID]?
let mappedSeasonNumber: Season.ID?

let episodeNumbers: [Episode.ID]?
Expand Down Expand Up @@ -94,6 +95,7 @@ struct SeriesRelease: Identifiable, Codable {
case episodeId
case episodeIds
case seasonNumber
case seasonNumbers
case mappedSeasonNumber
case episodeNumbers
case mappedEpisodeNumbers
Expand Down Expand Up @@ -132,6 +134,10 @@ struct SeriesRelease: Identifiable, Codable {
quality.revision.isRepack
}

var isMultiSeason: Bool {
fullSeason && (seasonNumbers?.count ?? 0) > 1
}

var hasCustomFormats: Bool {
if let formats = customFormats {
return !formats.isEmpty
Expand Down
10 changes: 7 additions & 3 deletions Ruddarr/Models/Series/SeriesReleaseSort.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,25 @@ struct SeriesReleaseSort: Equatable {
var id: Self { self }

case any
case season
case episode
case season
case multiSeason

var label: String {
switch self {
case .any: String(localized: "Any", comment: "Season pack or single episode option")
case .season: String(localized: "Season Pack")
case .episode: String(localized: "Single Episode")
case .season: String(localized: "Season Pack")
case .multiSeason: String(localized: "Multi-Season Pack")
}
}

var icon: String {
switch self {
case .any: "square.stack.3d.up"
case .season: "shippingbox"
case .episode: "numbersign"
case .season: "shippingbox"
case .multiSeason: "archivebox"
}
}
}
Expand Down Expand Up @@ -140,6 +143,7 @@ struct SeriesReleaseSort: Equatable {
(customFormat == .all || release.customFormats?.contains { $0.name == customFormat } ?? false) &&
(releaseGroup == .all || release.releaseGroupLabel?.caseInsensitiveCompare(releaseGroup) == .orderedSame) &&
(seasonPack != .season || release.fullSeason) &&
(seasonPack != .multiSeason || release.isMultiSeason) &&
(seasonPack != .episode || !release.fullSeason) &&
(!approved || !release.rejected) &&
(!freeleech || release.isFreeleech) &&
Expand Down
4 changes: 4 additions & 0 deletions Ruddarr/Models/Series/SeriesReleases.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ class SeriesReleases {
var customFormats: [String] = []
var releaseGroups: [String] = []

var hasMultiSeasonPacks: Bool {
items.contains(where: \.isMultiSeason)
}

init(_ instance: Instance) {
self.instance = instance
}
Expand Down
4 changes: 3 additions & 1 deletion Ruddarr/Views/Series/Releases/SeriesReleasesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,9 @@ extension SeriesReleasesView {
var seasonPackPicker: some View {
Picker("Season Pack", selection: $sort.seasonPack) {
ForEach(SeriesReleaseSort.SeasonPack.allCases) { item in
Label(item.label, systemImage: item.icon).tag(Optional.some(item))
if item != .multiSeason || instance.releases.hasMultiSeasonPacks {
Label(item.label, systemImage: item.icon).tag(Optional.some(item))
}
}
}
.pickerStyle(.inline)
Expand Down
1 change: 1 addition & 0 deletions TestFlight/WhatToTest.en-US.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Added
- Show release details for failed and ignored history events
- Show when a release was previously grabbed or failed in Radarr's interactive search
- Show when a release was previously grabbed or failed in Sonarr v5's interactive search
- Filter Sonarr v5 releases by multi-season pack

Fixed
- Open the exact movie on Letterboxd instead of a search
Expand Down
Loading