Skip to content

Commit

Permalink
Merge pull request #228 from tatsuz0u/develop
Browse files Browse the repository at this point in the history
Bugfixes & New app icon
  • Loading branch information
tatsuz0u authored Feb 14, 2022
2 parents ff0259b + f2e58c6 commit df79ab7
Show file tree
Hide file tree
Showing 36 changed files with 241 additions and 143 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
types: [closed]
env:
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app
APP_VERSION: '2.2.0'
APP_VERSION: '2.2.1'
SCHEME_NAME: 'EhPanda'
ALTSTORE_JSON_PATH: './AltStore.json'
BUILDS_PATH: '/tmp/action-builds'
Expand Down
76 changes: 60 additions & 16 deletions EhPanda.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file modified EhPanda/App/Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified EhPanda/App/Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added EhPanda/App/Icons/AppIcon_Default_iPad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added EhPanda/App/Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added EhPanda/App/Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added EhPanda/App/Icons/AppIcon_Developer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added EhPanda/App/Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added EhPanda/App/Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added EhPanda/App/Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added EhPanda/App/Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added EhPanda/App/Icons/AppIcon_Ukiyoe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified EhPanda/App/Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added EhPanda/App/Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added EhPanda/App/Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
125 changes: 71 additions & 54 deletions EhPanda/App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,60 +8,77 @@
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIcons</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>AppIcon_Default</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon_Default</string>
</array>
</dict>
<key>AppIcon_Ukiyoe</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon_Ukiyoe</string>
</array>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array/>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
</dict>
<key>CFBundleIcons~ipad</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>AppIcon_Default</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon_Default</string>
</array>
</dict>
<key>AppIcon_Ukiyoe</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon_Ukiyoe</string>
</array>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array/>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
</dict>
<key>CFBundleIcons</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>AppIcon_Default</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon_Default</string>
</array>
</dict>
<key>AppIcon_Ukiyoe</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon_Ukiyoe</string>
</array>
</dict>
<key>AppIcon_Developer</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon_Developer</string>
</array>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array/>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
</dict>
<key>CFBundleIcons~ipad</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>AppIcon_Default</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon_Default_iPad</string>
<string>AppIcon_Default_iPad_Pro</string>
</array>
</dict>
<key>AppIcon_Ukiyoe</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon_Ukiyoe_iPad</string>
<string>AppIcon_Ukiyoe_iPad_Pro</string>
</array>
</dict>
<key>AppIcon_Developer</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon_Developer_iPad</string>
<string>AppIcon_Developer_iPad_Pro</string>
</array>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array/>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
</dict>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand Down
19 changes: 14 additions & 5 deletions EhPanda/App/Tools/Clients/ClipboardClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@

import SwiftUI
import ComposableArchitecture
import UniformTypeIdentifiers

struct ClipboardClient {
let url: () -> URL?
let changeCount: () -> Int
let saveText: (String) -> Effect<Never, Never>
let saveImage: (UIImage) -> Effect<Never, Never>
let saveImage: (UIImage, Bool) -> Effect<Never, Never>
}

extension ClipboardClient {
Expand All @@ -27,14 +28,22 @@ extension ClipboardClient {
changeCount: {
UIPasteboard.general.changeCount
},
saveText: { value in
saveText: { text in
.fireAndForget {
UIPasteboard.general.string = value
UIPasteboard.general.string = text
}
},
saveImage: { value in
saveImage: { (image, isAnimated) in
.fireAndForget {
UIPasteboard.general.image = value
if isAnimated {
DispatchQueue.global(qos: .utility).async {
if let data = image.kf.data(format: .GIF) {
UIPasteboard.general.setData(data, forPasteboardType: UTType.gif.identifier)
}
}
} else {
UIPasteboard.general.image = image
}
}
}
)
Expand Down
20 changes: 15 additions & 5 deletions EhPanda/App/Tools/Clients/ImageClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
// Created by 荒木辰造 on R 4/01/23.
//

import Photos
import SwiftUI
import Combine
import Kingfisher
import ComposableArchitecture

struct ImageClient {
let prefetchImages: ([URL]) -> Effect<Never, Never>
let saveImageToPhotoLibrary: (UIImage) -> Effect<Bool, Never>
let saveImageToPhotoLibrary: (UIImage, Bool) -> Effect<Bool, Never>
let downloadImage: (URL) -> Effect<Result<UIImage, Error>, Never>
let retrieveImage: (String) -> Effect<Result<UIImage, Error>, Never>
}
Expand All @@ -24,14 +25,23 @@ extension ImageClient {
ImagePrefetcher(urls: urls).start()
}
},
saveImageToPhotoLibrary: { image in
saveImageToPhotoLibrary: { (image, isAnimated) in
Future { promise in
let imageSaver = ImageSaver { isSuccess in
promise(.success(isSuccess))
DispatchQueue.global(qos: .utility).async {
if let data = image.kf.data(format: isAnimated ? .GIF : .unknown) {
PHPhotoLibrary.shared().performChanges {
let request = PHAssetCreationRequest.forAsset()
request.addResource(with: .photo, data: data, options: nil)
} completionHandler: { (isSuccess, _) in
promise(.success(isSuccess))
}
} else {
promise(.success(false))
}
}
imageSaver.saveImage(image)
}
.eraseToAnyPublisher()
.receive(on: DispatchQueue.main)
.eraseToEffect()
},
downloadImage: { url in
Expand Down
4 changes: 4 additions & 0 deletions EhPanda/App/Tools/Extensions/Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ extension Float {
extension URL {
static let mock = Defaults.URL.ehentai

var isGIF: Bool {
pathExtension == "gif"
}

func appending(queryItems: [URLQueryItem]) -> URL {
var components: URLComponents = .init(
url: self, resolvingAgainstBaseURL: false
Expand Down
3 changes: 3 additions & 0 deletions EhPanda/App/Tools/Utilities/FileUtil.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ struct FileUtil {
static var logsDirectoryURL: URL? {
documentDirectory?.appendingPathComponent(Defaults.FilePath.logs)
}
static var temporaryDirectory: URL {
.init(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true)
}

static func url(for searchPathDirectory: FileManager.SearchPathDirectory) -> URL? {
try? FileManager.default.url(for: searchPathDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
Expand Down
1 change: 1 addition & 0 deletions EhPanda/App/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@
// AppIconType
"enum.app.icon.type.value.default" = "Standard";
"enum.app.icon.type.value.ukiyoe" = "Ukiyo-e";
"enum.app.icon.type.value.developer" = "Developer";
// ListDisplayMode
"enum.display.mode.value.detail" = "Detail";
"enum.display.mode.value.thumbnail" = "Thumbnail";
Expand Down
1 change: 1 addition & 0 deletions EhPanda/App/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@
// AppIconType
"enum.app.icon.type.value.default" = "Default";
"enum.app.icon.type.value.ukiyoe" = "Ukiyo-e";
"enum.app.icon.type.value.developer" = "Developer";
// ListDisplayMode
"enum.display.mode.value.detail" = "Detail";
"enum.display.mode.value.thumbnail" = "Thumbnail";
Expand Down
1 change: 1 addition & 0 deletions EhPanda/App/ja.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@
// AppIconType
"enum.app.icon.type.value.default" = "デフォルト";
"enum.app.icon.type.value.ukiyoe" = "浮世絵";
"enum.app.icon.type.value.developer" = "デベロッパー";
// ListDisplayMode
"enum.display.mode.value.detail" = "デフォルト";
"enum.display.mode.value.thumbnail" = "サムネイル";
Expand Down
1 change: 1 addition & 0 deletions EhPanda/App/ko.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@
// AppIconType
"enum.app.icon.type.value.default" = "기본";
"enum.app.icon.type.value.ukiyoe" = "Ukiyo-e";
"enum.app.icon.type.value.developer" = "Developer";
// ListDisplayMode
"enum.display.mode.value.detail" = "자세히";
"enum.display.mode.value.thumbnail" = "썸네일";
Expand Down
1 change: 1 addition & 0 deletions EhPanda/App/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@
// AppIconType
"enum.app.icon.type.value.default" = "默认";
"enum.app.icon.type.value.ukiyoe" = "浮世绘";
"enum.app.icon.type.value.developer" = "开发者";
// ListDisplayMode
"enum.display.mode.value.detail" = "详情";
"enum.display.mode.value.thumbnail" = "缩略图";
Expand Down
1 change: 1 addition & 0 deletions EhPanda/App/zh-Hant.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@
// AppIconType
"enum.app.icon.type.value.default" = "預設";
"enum.app.icon.type.value.ukiyoe" = "Ukiyo-e";
"enum.app.icon.type.value.developer" = "Developer";
// ListDisplayMode
"enum.display.mode.value.detail" = "詳情";
"enum.display.mode.value.thumbnail" = "縮略圖";
Expand Down
3 changes: 1 addition & 2 deletions EhPanda/Database/Migration/CoreDataMigrator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ class CoreDataMigrator: CoreDataMigratorProtocol {
let manager = NSMigrationManager(
sourceModel: migrationStep.sourceModel, destinationModel: migrationStep.destinationModel
)
let destinationURL = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true)
.appendingPathComponent(UUID().uuidString)
let destinationURL = FileUtil.temporaryDirectory.appendingPathComponent(UUID().uuidString)

do {
try manager.migrateStore(
Expand Down
7 changes: 2 additions & 5 deletions EhPanda/Models/Gallery/Language.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ enum Language: String, Codable {
}

extension Language {
var isLiveTextAvailable: Bool {
!codes.isEmpty
}
var codes: [String] {
var codes: [String]? {
switch self {
case .english:
return ["en-US"]
Expand All @@ -36,7 +33,7 @@ extension Language {
case .chinese:
return ["zh-Hans", "zh-Hant"]
default:
return []
return nil
}
}
var abbreviation: String {
Expand Down
Loading

0 comments on commit df79ab7

Please sign in to comment.