Skip to content

Commit 8baca8f

Browse files
Made first and last air date in TMDBShowData optional
1 parent d4daa9a commit 8baca8f

File tree

5 files changed

+24
-15
lines changed

5 files changed

+24
-15
lines changed

Movie DB.xcodeproj/project.pbxproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,6 +1741,8 @@
17411741
ENABLE_PREVIEWS = YES;
17421742
GCC_WARN_UNUSED_LABEL = YES;
17431743
INFOPLIST_FILE = "Movie DB/Info.plist";
1744+
INFOPLIST_KEY_CFBundleDisplayName = "Movie DB";
1745+
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.entertainment";
17441746
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
17451747
LD_RUNPATH_SEARCH_PATHS = (
17461748
"$(inherited)",
@@ -1750,7 +1752,7 @@
17501752
"$(inherited)",
17511753
"$(SDKROOT)/usr/lib/swift",
17521754
);
1753-
MARKETING_VERSION = 1.4.0;
1755+
MARKETING_VERSION = 1.4.1;
17541756
PRODUCT_BUNDLE_IDENTIFIER = "de.JonasFrey.Movie-DB";
17551757
PRODUCT_NAME = "$(TARGET_NAME)";
17561758
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@@ -1774,6 +1776,8 @@
17741776
ENABLE_PREVIEWS = YES;
17751777
GCC_WARN_UNUSED_LABEL = YES;
17761778
INFOPLIST_FILE = "Movie DB/Info.plist";
1779+
INFOPLIST_KEY_CFBundleDisplayName = "Movie DB";
1780+
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.entertainment";
17771781
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
17781782
LD_RUNPATH_SEARCH_PATHS = (
17791783
"$(inherited)",
@@ -1783,7 +1787,7 @@
17831787
"$(inherited)",
17841788
"$(SDKROOT)/usr/lib/swift",
17851789
);
1786-
MARKETING_VERSION = 1.4.0;
1790+
MARKETING_VERSION = 1.4.1;
17871791
PRODUCT_BUNDLE_IDENTIFIER = "de.JonasFrey.Movie-DB";
17881792
PRODUCT_NAME = "$(TARGET_NAME)";
17891793
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

Movie DB/Info.plist

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,13 @@
5454
<key>UISupportedInterfaceOrientations</key>
5555
<array>
5656
<string>UIInterfaceOrientationPortrait</string>
57-
<string>UIInterfaceOrientationLandscapeLeft</string>
58-
<string>UIInterfaceOrientationLandscapeRight</string>
5957
</array>
6058
<key>UISupportedInterfaceOrientations~ipad</key>
6159
<array>
62-
<string>UIInterfaceOrientationPortrait</string>
63-
<string>UIInterfaceOrientationPortraitUpsideDown</string>
6460
<string>UIInterfaceOrientationLandscapeLeft</string>
6561
<string>UIInterfaceOrientationLandscapeRight</string>
62+
<string>UIInterfaceOrientationPortrait</string>
63+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
6664
</array>
6765
</dict>
6866
</plist>

Movie DB/Models/TMDBData/ShowData.swift

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,20 @@ import Foundation
1010

1111
extension TMDBData {
1212
struct ShowData: Decodable, Hashable {
13-
var rawFirstAirDate: String
13+
var rawFirstAirDate: String?
1414
var firstAirDate: Date? {
15-
Utils.tmdbDateFormatter.date(from: rawFirstAirDate)
15+
guard let rawFirstAirDate else {
16+
return nil
17+
}
18+
return Utils.tmdbDateFormatter.date(from: rawFirstAirDate)
1619
}
1720

18-
var rawLastAirDate: String
21+
var rawLastAirDate: String?
1922
var lastAirDate: Date? {
20-
Utils.tmdbDateFormatter.date(from: rawLastAirDate)
23+
guard let rawLastAirDate else {
24+
return nil
25+
}
26+
return Utils.tmdbDateFormatter.date(from: rawLastAirDate)
2127
}
2228

2329
var lastEpisodeToAir: Episode?
@@ -32,8 +38,8 @@ extension TMDBData {
3238
var createdBy: [String]
3339

3440
init(
35-
rawFirstAirDate: String,
36-
rawLastAirDate: String,
41+
rawFirstAirDate: String?,
42+
rawLastAirDate: String?,
3743
lastEpisodeToAir: Episode? = nil,
3844
nextEpisodeToAir: Episode? = nil,
3945
numberOfSeasons: Int? = nil,
@@ -61,8 +67,8 @@ extension TMDBData {
6167

6268
init(from decoder: Decoder) throws {
6369
let container = try decoder.container(keyedBy: CodingKeys.self)
64-
rawFirstAirDate = try container.decode(String.self, forKey: .rawFirstAirDate)
65-
rawLastAirDate = try container.decode(String.self, forKey: .rawLastAirDate)
70+
rawFirstAirDate = try container.decode(String?.self, forKey: .rawFirstAirDate)
71+
rawLastAirDate = try container.decode(String?.self, forKey: .rawLastAirDate)
6672
numberOfSeasons = try container.decode(Int?.self, forKey: .numberOfSeasons)
6773
numberOfEpisodes = try container.decode(Int.self, forKey: .numberOfEpisodes)
6874
episodeRuntime = try container.decode([Int].self, forKey: .episodeRuntime)

Movie DB/Views/Library/LibraryHome.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ struct LibraryHome: View {
5454
sortingDirection: sortingDirection
5555
)
5656
.searchable(text: $searchText)
57+
.background(.thinMaterial)
5758
}
5859
.onAppear {
5960
if JFConfig.shared.libraryWasReset {

Movie DB/Views/MediaLists/MediaListsView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ struct UserListsView: View {
158158
return
159159
}
160160
// Check on equality, ignoring case
161-
guard !allLists.map(\.name).map { $0.lowercased() }.contains(text.lowercased()) else {
161+
guard !allLists.map(\.name).map({ $0.lowercased() }).contains(text.lowercased()) else {
162162
AlertHandler.showSimpleAlert(
163163
title: Strings.Lists.Alert.alreadyExistsTitle,
164164
message: Strings.Lists.Alert.alreadyExistsMessage(text)

0 commit comments

Comments
 (0)