Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] [iOS] Media Item Menu - Edit Item Images #1345

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
305a9b5
Good start but some missing items:
JPKribs Dec 8, 2024
8b813ba
Upload still failing but now update and set are 2 different processes…
JPKribs Dec 8, 2024
0699c80
~70% Complete
JPKribs Dec 8, 2024
0313790
Merge branch 'jellyfin:main' into editItemImages
JPKribs Dec 8, 2024
480b94d
Merge with Main
JPKribs Dec 8, 2024
babc444
Merge branch 'main' into editItemImages
JPKribs Dec 11, 2024
2d9cf7c
Merge branch 'main' into editItemImages
JPKribs Dec 14, 2024
c246de7
Merge branch 'jellyfin:main' into editItemImages
JPKribs Dec 20, 2024
f21bb99
URL Changes
JPKribs Dec 20, 2024
fa29173
Updating logic and confirmation screen
JPKribs Dec 20, 2024
57cf69c
Merge branch 'jellyfin:main' into editItemImages
JPKribs Dec 20, 2024
da3a8ed
Lots of changes:
JPKribs Dec 21, 2024
731a386
Merge remote-tracking branch 'refs/remotes/origin/editItemImages'
JPKribs Dec 21, 2024
daca500
Merge branch 'jellyfin:main' into editItemImages
JPKribs Dec 21, 2024
33f38bd
Breaking this even more with the hopes of a better tomorrow.
JPKribs Dec 22, 2024
51d0148
Merge remote-tracking branch 'refs/remotes/origin/editItemImages'
JPKribs Dec 22, 2024
08a8107
Getting better?
JPKribs Dec 22, 2024
938cc2b
Refreshing is working but I might need to make this work mroe effient…
JPKribs Dec 22, 2024
26677c7
90% There!
JPKribs Dec 23, 2024
bccfcef
Ability to cancel the update
JPKribs Dec 23, 2024
9949b72
Still no luck uploading images?
JPKribs Dec 23, 2024
206fbff
Merge branch 'jellyfin:main' into editItemImages
JPKribs Dec 28, 2024
1dac7cd
Stop reordering on deletion/addition
JPKribs Dec 29, 2024
2c3cfed
Merge remote-tracking branch 'refs/remotes/origin/editItemImages'
JPKribs Dec 29, 2024
d3b20b9
Merge branch 'jellyfin:main' into editItemImages
JPKribs Dec 29, 2024
483db8c
Merge branch 'main' into editItemImages
JPKribs Dec 31, 2024
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
18 changes: 18 additions & 0 deletions Shared/Coordinators/ItemEditorCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ final class ItemEditorCoordinator: ObservableObject, NavigationCoordinatable {
@Route(.modal)
var editMetadata = makeEditMetadata

// MARK: - Route to Metadata

@Route(.push)
var editImages = makeEditImages
@Route(.push)
var addImage = makeAddImage

// MARK: - Route to Genres

@Route(.push)
Expand Down Expand Up @@ -73,6 +80,17 @@ final class ItemEditorCoordinator: ObservableObject, NavigationCoordinatable {
}
}

// MARK: - Item Images

@ViewBuilder
func makeEditImages(item: BaseItemDto) -> some View {
EditItemImagesView(viewModel: ItemImagesViewModel(item: item))
}

func makeAddImage(viewModel: RemoteImageInfoViewModel) -> some View {
AddItemImageView(viewModel: viewModel)
}

// MARK: - Item Genres

@ViewBuilder
Expand Down
17 changes: 17 additions & 0 deletions Shared/Extensions/JellyfinAPI/ImageInfo.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// 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

// TODO: How SHOULD I get Identifiable
extension ImageInfo: @retroactive Identifiable {
public var id: String {
self.imageTag?.hashString ?? UUID().uuidString
}
}
18 changes: 18 additions & 0 deletions Shared/Extensions/JellyfinAPI/RemoteImageInfo.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// 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 RemoteImageInfo: @retroactive Identifiable {

public var id: String {
UUID().uuidString
}
}
4 changes: 4 additions & 0 deletions Shared/Strings/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ internal enum L10n {
}
/// Are you sure you wish to delete this device? This session will be logged out.
internal static let deleteDeviceWarning = L10n.tr("Localizable", "deleteDeviceWarning", fallback: "Are you sure you wish to delete this device? This session will be logged out.")
/// Delete image
internal static let deleteImage = L10n.tr("Localizable", "deleteImage", fallback: "Delete image")
/// Are you sure you want to delete this item?
internal static let deleteItemConfirmation = L10n.tr("Localizable", "deleteItemConfirmation", fallback: "Are you sure you want to delete this item?")
/// Are you sure you want to delete this item? This action cannot be undone.
Expand Down Expand Up @@ -612,6 +614,8 @@ internal enum L10n {
internal static let idle = L10n.tr("Localizable", "idle", fallback: "Idle")
/// Illustrator
internal static let illustrator = L10n.tr("Localizable", "illustrator", fallback: "Illustrator")
/// Images
internal static let images = L10n.tr("Localizable", "images", fallback: "Images")
/// Indicators
internal static let indicators = L10n.tr("Localizable", "indicators", fallback: "Indicators")
/// Inker
Expand Down
Loading