-
-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[iOS] Media Item Menu - Identify Media Item (#1369)
* WIP * All item types. * V2: Functionally better. UI still weird * Rework! * Organization, new LoadingIcon, remove unnecessary components, and standardize: CancellableLoadingButton * Organization & Static Method Re-Use. * wip * fix tvOS * wip * localize * Update RemoteSearchResultRow.swift * Update Localizable.strings * Update RemoteSearchResultRow.swift --------- Co-authored-by: Ethan Pippin <[email protected]>
- Loading branch information
Showing
23 changed files
with
779 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// | ||
// Swiftfin is subject to the terms of the Mozilla Public | ||
// License, v2.0. If a copy of the MPL was not distributed with this | ||
// file, you can obtain one at https://mozilla.org/MPL/2.0/. | ||
// | ||
// Copyright (c) 2024 Jellyfin & Jellyfin Contributors | ||
// | ||
|
||
import Foundation | ||
import JellyfinAPI | ||
import SwiftUI | ||
|
||
extension RemoteSearchResult: Displayable { | ||
|
||
var displayTitle: String { | ||
name ?? L10n.unknown | ||
} | ||
} | ||
|
||
// TODO: fix in SDK, should already be equatable | ||
extension RemoteSearchResult: @retroactive Hashable, @retroactive Identifiable { | ||
|
||
public var id: Int { | ||
hashValue | ||
} | ||
|
||
public func hash(into hasher: inout Hasher) { | ||
hasher.combine(albumArtist) | ||
hasher.combine(artists) | ||
hasher.combine(imageURL) | ||
hasher.combine(indexNumber) | ||
hasher.combine(indexNumberEnd) | ||
hasher.combine(name) | ||
hasher.combine(overview) | ||
hasher.combine(parentIndexNumber) | ||
hasher.combine(premiereDate) | ||
hasher.combine(productionYear) | ||
hasher.combine(providerIDs) | ||
hasher.combine(searchProviderName) | ||
} | ||
|
||
public static func == (lhs: RemoteSearchResult, rhs: RemoteSearchResult) -> Bool { | ||
lhs.albumArtist == rhs.albumArtist && | ||
lhs.artists == rhs.artists && | ||
lhs.imageURL == rhs.imageURL && | ||
lhs.indexNumber == rhs.indexNumber && | ||
lhs.indexNumberEnd == rhs.indexNumberEnd && | ||
lhs.name == rhs.name && | ||
lhs.overview == rhs.overview && | ||
lhs.parentIndexNumber == rhs.parentIndexNumber && | ||
lhs.premiereDate == rhs.premiereDate && | ||
lhs.productionYear == rhs.productionYear && | ||
lhs.providerIDs == rhs.providerIDs && | ||
lhs.searchProviderName == rhs.searchProviderName | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.