Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/gh-pages'
Browse files Browse the repository at this point in the history
  • Loading branch information
tfmart committed Mar 25, 2024
2 parents 9e07962 + 4a1ad19 commit 364bacb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Sources/ScrobbleKit/Public/Models/SBKAlbum.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public struct SBKAlbum: Decodable {
/// The playcount of the album.
public var playcount: Int?
/// The URL of the album on Last.fm.
public var url: String?
public var url: URL?
/// The number of listeners for the album.
public var listeners: Int?
/// The wiki information associated with the album.
Expand Down Expand Up @@ -81,7 +81,7 @@ public struct SBKAlbum: Decodable {
internal init(topAlbumArtist: SBKArtistTopAlbum) {
self.artist = topAlbumArtist.artist.name
self.name = topAlbumArtist.name
self.url = topAlbumArtist.url
self.url = URL(optionalString: topAlbumArtist.url)
self.musicBrainzID = UUID(optionalString: topAlbumArtist.mbid)
self.playcount = topAlbumArtist.playcount
self.image = topAlbumArtist.image
Expand All @@ -103,7 +103,7 @@ public struct SBKAlbum: Decodable {
self.playcount = try container.decodeIfPresent(IntegerStringDecoder.self, forKey: SBKAlbum.CodingKeys.playcount)?.intValue
self.image = try container.decodeIfPresent([SBKImageResponse].self, forKey: SBKAlbum.CodingKeys.image)
self.tracks = try container.decodeIfPresent(SBKAlbumTracksRequestResponseList.self, forKey: SBKAlbum.CodingKeys.tracks)
self.url = try container.decodeIfPresent(String.self, forKey: SBKAlbum.CodingKeys.url)
self.url = try container.decodeIfPresent(URL.self, forKey: SBKAlbum.CodingKeys.url)
self.listeners = try container.decodeIfPresent(IntegerStringDecoder.self, forKey: SBKAlbum.CodingKeys.listeners)?.intValue
self.wiki = try container.decodeIfPresent(SBKWiki.self, forKey: SBKAlbum.CodingKeys.wiki)

Expand Down
6 changes: 3 additions & 3 deletions Sources/ScrobbleKit/Public/Models/SBKTag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Foundation
public struct SBKTag: Decodable {

/// The URL for the tag on the Last.fm website.
public let url: String?
public let url: URL?

/// The name of the tag.
public let name: String
Expand All @@ -35,14 +35,14 @@ public struct SBKTag: Decodable {
public init(from decoder: Decoder) throws {
let container: KeyedDecodingContainer<SBKTag.CodingKeys> = try decoder.container(keyedBy: SBKTag.CodingKeys.self)

self.url = try container.decodeIfPresent(String.self, forKey: SBKTag.CodingKeys.url)
self.url = try container.decodeIfPresent(URL.self, forKey: SBKTag.CodingKeys.url)
self.name = try container.decode(String.self, forKey: SBKTag.CodingKeys.name)
self.reach = try container.decodeIfPresent(Int.self, forKey: SBKTag.CodingKeys.reach)
self.count = try? container.decodeIfPresent(Int.self, forKey: SBKTag.CodingKeys.count)
self.wiki = try container.decodeIfPresent(SBKWiki.self, forKey: SBKTag.CodingKeys.wiki)
}

internal init(url: String? = nil, name: String, reach: Int? = nil, count: Int? = nil, wiki: SBKWiki? = nil) {
internal init(url: URL? = nil, name: String, reach: Int? = nil, count: Int? = nil, wiki: SBKWiki? = nil) {
self.url = url
self.name = name
self.reach = reach
Expand Down
2 changes: 1 addition & 1 deletion docs/metadata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"schemaVersion":{"minor":1,"patch":0,"major":0},"bundleDisplayName":"ScrobbleKit","bundleIdentifier":"ScrobbleKit"}
{"bundleDisplayName":"ScrobbleKit","schemaVersion":{"major":0,"patch":0,"minor":1},"bundleIdentifier":"ScrobbleKit"}

0 comments on commit 364bacb

Please sign in to comment.