Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuz0u committed Jun 27, 2021
2 parents 59f1c24 + 8c482db commit a931e42
Show file tree
Hide file tree
Showing 14 changed files with 309 additions and 77 deletions.
48 changes: 26 additions & 22 deletions EhPanda.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/* Begin PBXBuildFile section */
AB018DD2268756D000EB0EA9 /* Kanna in Frameworks */ = {isa = PBXBuildFile; productRef = AB018DD1268756D000EB0EA9 /* Kanna */; };
AB19D619266E5C6700BA752A /* TTProgressHUD in Frameworks */ = {isa = PBXBuildFile; productRef = AB19D618266E5C6700BA752A /* TTProgressHUD */; };
AB2B0F3B2684228400777944 /* SwiftyBeaver in Frameworks */ = {isa = PBXBuildFile; productRef = AB2B0F3A2684228400777944 /* SwiftyBeaver */; };
AB2F72BF2685A8B00088DECA /* Kingfisher in Frameworks */ = {isa = PBXBuildFile; productRef = AB2F72BE2685A8B00088DECA /* Kingfisher */; };
AB38A0CB25CA993D00764D64 /* ColorCodable.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB38A0CA25CA993D00764D64 /* ColorCodable.swift */; };
AB40CFDC25983EC200D1DC9A /* FileStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB40CFDB25983EC200D1DC9A /* FileStorage.swift */; };
Expand All @@ -24,6 +23,8 @@
AB47FDB425BC859E0007765D /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = AB47FDB125BC859E0007765D /* [email protected] */; };
AB47FDB525BC859E0007765D /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = AB47FDB225BC859E0007765D /* [email protected] */; };
AB47FDB625BC859E0007765D /* Weird-ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = AB47FDB325BC859E0007765D /* Weird-ipad.png */; };
AB6DE897268822390087C579 /* LogsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB6DE896268822390087C579 /* LogsView.swift */; };
AB6DE89A268861790087C579 /* SwiftyBeaver in Frameworks */ = {isa = PBXBuildFile; productRef = AB6DE899268861790087C579 /* SwiftyBeaver */; };
AB7E6B3025D24FE00035CC68 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AB7E6B3225D24FE00035CC68 /* InfoPlist.strings */; };
ABA732D925A8018A00B3D9AB /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABA732D825A8018A00B3D9AB /* Extensions.swift */; };
ABA732DF25A852D800B3D9AB /* Filter.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABA732DE25A852D800B3D9AB /* Filter.swift */; };
Expand All @@ -34,7 +35,7 @@
ABC3C7872593699B00E0C11B /* EhPandaApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC3C76B2593699A00E0C11B /* EhPandaApp.swift */; };
ABC3C7892593699B00E0C11B /* Defaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC3C76D2593699A00E0C11B /* Defaults.swift */; };
ABC3C78F2593699B00E0C11B /* ViewModifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC3C7762593699A00E0C11B /* ViewModifiers.swift */; };
ABC3C7962593699B00E0C11B /* Manga.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC3C7802593699A00E0C11B /* Manga.swift */; };
ABC3C7962593699B00E0C11B /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC3C7802593699A00E0C11B /* Models.swift */; };
ABCD2F0A259763FC008E5A20 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABCD2F09259763FC008E5A20 /* Request.swift */; };
ABCD2F0E25976B95008E5A20 /* Parser.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABCD2F0D25976B95008E5A20 /* Parser.swift */; };
ABD5FDD4263D05110021A4C6 /* .swiftlint.yml in Resources */ = {isa = PBXBuildFile; fileRef = ABD5FDD3263D05110021A4C6 /* .swiftlint.yml */; };
Expand Down Expand Up @@ -89,6 +90,7 @@
AB47FDB125BC859E0007765D /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
AB47FDB225BC859E0007765D /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
AB47FDB325BC859E0007765D /* Weird-ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Weird-ipad.png"; sourceTree = "<group>"; };
AB6DE896268822390087C579 /* LogsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogsView.swift; sourceTree = "<group>"; };
AB7E6B3125D24FE00035CC68 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/InfoPlist.strings; sourceTree = "<group>"; };
AB7E6B3425D24FE40035CC68 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
AB7E6B3525D24FE50035CC68 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
Expand All @@ -104,7 +106,7 @@
ABC3C76D2593699A00E0C11B /* Defaults.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Defaults.swift; sourceTree = "<group>"; };
ABC3C76E2593699A00E0C11B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
ABC3C7762593699A00E0C11B /* ViewModifiers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewModifiers.swift; sourceTree = "<group>"; };
ABC3C7802593699A00E0C11B /* Manga.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Manga.swift; sourceTree = "<group>"; };
ABC3C7802593699A00E0C11B /* Models.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = "<group>"; };
ABCD2F09259763FC008E5A20 /* Request.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Request.swift; sourceTree = "<group>"; };
ABCD2F0D25976B95008E5A20 /* Parser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Parser.swift; sourceTree = "<group>"; };
ABD5FDD3263D05110021A4C6 /* .swiftlint.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -154,8 +156,8 @@
buildActionMask = 2147483647;
files = (
ABE0FA2F25D4CAEC00E52F18 /* SDWebImageSwiftUI in Frameworks */,
AB2B0F3B2684228400777944 /* SwiftyBeaver in Frameworks */,
AB19D619266E5C6700BA752A /* TTProgressHUD in Frameworks */,
AB6DE89A268861790087C579 /* SwiftyBeaver in Frameworks */,
AB2F72BF2685A8B00088DECA /* Kingfisher in Frameworks */,
AB018DD2268756D000EB0EA9 /* Kanna in Frameworks */,
);
Expand Down Expand Up @@ -253,7 +255,7 @@
children = (
ABF75F3E25A19CD200544D29 /* User.swift */,
ABA732DE25A852D800B3D9AB /* Filter.swift */,
ABC3C7802593699A00E0C11B /* Manga.swift */,
ABC3C7802593699A00E0C11B /* Models.swift */,
ABEA1FE525A9B40B002966B9 /* Setting.swift */,
ABF313A425B1AB6600D47A2F /* Misc.swift */,
);
Expand Down Expand Up @@ -342,6 +344,7 @@
ABF45ADB25F3313D00ECB568 /* ReadingSettingView.swift */,
ABF45ADE25F3313D00ECB568 /* EhPandaView.swift */,
ABF45ADA25F3313D00ECB568 /* WebView.swift */,
AB6DE896268822390087C579 /* LogsView.swift */,
);
path = Setting;
sourceTree = "<group>";
Expand All @@ -366,9 +369,9 @@
packageProductDependencies = (
ABE0FA2E25D4CAEC00E52F18 /* SDWebImageSwiftUI */,
AB19D618266E5C6700BA752A /* TTProgressHUD */,
AB2B0F3A2684228400777944 /* SwiftyBeaver */,
AB2F72BE2685A8B00088DECA /* Kingfisher */,
AB018DD1268756D000EB0EA9 /* Kanna */,
AB6DE899268861790087C579 /* SwiftyBeaver */,
);
productName = EhPanda;
productReference = ABC3C7542593696C00E0C11B /* EhPanda.app */;
Expand Down Expand Up @@ -403,9 +406,9 @@
packageReferences = (
ABE0FA2D25D4CAEC00E52F18 /* XCRemoteSwiftPackageReference "SDWebImageSwiftUI" */,
AB19D617266E5C6700BA752A /* XCRemoteSwiftPackageReference "TTProgressHUD" */,
AB2B0F392684228400777944 /* XCRemoteSwiftPackageReference "SwiftyBeaver" */,
AB2F72BD2685A8B00088DECA /* XCRemoteSwiftPackageReference "Kingfisher" */,
AB018DD0268756D000EB0EA9 /* XCRemoteSwiftPackageReference "Kanna" */,
AB6DE898268861790087C579 /* XCRemoteSwiftPackageReference "SwiftyBeaver" */,
);
productRefGroup = ABC3C7552593696C00E0C11B /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -490,6 +493,7 @@
ABF45AF725F3313D00ECB568 /* SettingView.swift in Sources */,
ABF45AEA25F3313D00ECB568 /* Placeholder.swift in Sources */,
ABF45AE125F3313D00ECB568 /* Home.swift in Sources */,
AB6DE897268822390087C579 /* LogsView.swift in Sources */,
ABF45AF025F3313D00ECB568 /* CommentView.swift in Sources */,
ABF45AE325F3313D00ECB568 /* SlideMenu.swift in Sources */,
ABF45AE225F3313D00ECB568 /* AuthView.swift in Sources */,
Expand All @@ -503,7 +507,7 @@
ABF45AEE25F3313D00ECB568 /* ArchiveView.swift in Sources */,
ABF45AEC25F3313D00ECB568 /* ContentView.swift in Sources */,
ABEA1FE625A9B40B002966B9 /* Setting.swift in Sources */,
ABC3C7962593699B00E0C11B /* Manga.swift in Sources */,
ABC3C7962593699B00E0C11B /* Models.swift in Sources */,
ABC3C7872593699B00E0C11B /* EhPandaApp.swift in Sources */,
ABF313A525B1AB6600D47A2F /* Misc.swift in Sources */,
ABA732DF25A852D800B3D9AB /* Filter.swift in Sources */,
Expand Down Expand Up @@ -745,8 +749,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/tid-kijyun/Kanna.git";
requirement = {
kind = revision;
revision = 211beb276b7563eb9bb09474ce2d5f2176976232;
branch = master;
kind = branch;
};
};
AB19D617266E5C6700BA752A /* XCRemoteSwiftPackageReference "TTProgressHUD" */ = {
Expand All @@ -757,19 +761,19 @@
kind = branch;
};
};
AB2B0F392684228400777944 /* XCRemoteSwiftPackageReference "SwiftyBeaver" */ = {
AB2F72BD2685A8B00088DECA /* XCRemoteSwiftPackageReference "Kingfisher" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/SwiftyBeaver/SwiftyBeaver.git";
repositoryURL = "https://github.com/tatsuz0u/Kingfisher";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.9.5;
branch = "Xcode-13-fix";
kind = branch;
};
};
AB2F72BD2685A8B00088DECA /* XCRemoteSwiftPackageReference "Kingfisher" */ = {
AB6DE898268861790087C579 /* XCRemoteSwiftPackageReference "SwiftyBeaver" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/tatsuz0u/Kingfisher";
repositoryURL = "https://github.com/tatsuz0u/SwiftyBeaver";
requirement = {
branch = "Xcode-13-fix";
branch = "expose-calendar";
kind = branch;
};
};
Expand All @@ -794,16 +798,16 @@
package = AB19D617266E5C6700BA752A /* XCRemoteSwiftPackageReference "TTProgressHUD" */;
productName = TTProgressHUD;
};
AB2B0F3A2684228400777944 /* SwiftyBeaver */ = {
isa = XCSwiftPackageProductDependency;
package = AB2B0F392684228400777944 /* XCRemoteSwiftPackageReference "SwiftyBeaver" */;
productName = SwiftyBeaver;
};
AB2F72BE2685A8B00088DECA /* Kingfisher */ = {
isa = XCSwiftPackageProductDependency;
package = AB2F72BD2685A8B00088DECA /* XCRemoteSwiftPackageReference "Kingfisher" */;
productName = Kingfisher;
};
AB6DE899268861790087C579 /* SwiftyBeaver */ = {
isa = XCSwiftPackageProductDependency;
package = AB6DE898268861790087C579 /* XCRemoteSwiftPackageReference "SwiftyBeaver" */;
productName = SwiftyBeaver;
};
ABE0FA2E25D4CAEC00E52F18 /* SDWebImageSwiftUI */ = {
isa = XCSwiftPackageProductDependency;
package = ABE0FA2D25D4CAEC00E52F18 /* XCRemoteSwiftPackageReference "SDWebImageSwiftUI" */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"package": "Kanna",
"repositoryURL": "https://github.com/tid-kijyun/Kanna.git",
"state": {
"branch": null,
"branch": "master",
"revision": "211beb276b7563eb9bb09474ce2d5f2176976232",
"version": null
}
Expand Down Expand Up @@ -39,11 +39,11 @@
},
{
"package": "SwiftyBeaver",
"repositoryURL": "https://github.com/SwiftyBeaver/SwiftyBeaver.git",
"repositoryURL": "https://github.com/tatsuz0u/SwiftyBeaver",
"state": {
"branch": null,
"revision": "2c039501d6eeb4d4cd4aec4a8d884ad28862e044",
"version": "1.9.5"
"branch": "expose-calendar",
"revision": "e5d55d02b571aa9b8a833db519ca9d794380c7fc",
"version": null
}
},
{
Expand Down
54 changes: 29 additions & 25 deletions EhPanda/App/Defaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,43 @@ struct Defaults {
}
}
struct ImageSize {
static var rowScale: CGFloat = 8/11
static var avatarScale: CGFloat = 1/1
static var headerScale: CGFloat = 8/11
static var previewScale: CGFloat = 32/45
static var contentHScale: CGFloat = 7/10
static let rowScale: CGFloat = 8/11
static let avatarScale: CGFloat = 1/1
static let headerScale: CGFloat = 8/11
static let previewScale: CGFloat = 32/45
static let contentHScale: CGFloat = 7/10

static var rowW: CGFloat = rowH * rowScale
static var rowH: CGFloat = 110
static var avatarW: CGFloat = 100
static var avatarH: CGFloat = 100
static var headerW: CGFloat = headerH * headerScale
static var headerH: CGFloat = 150
static var previewW: CGFloat = previewH * previewScale
static var previewH: CGFloat = 200
static let rowW: CGFloat = rowH * rowScale
static let rowH: CGFloat = 110
static let avatarW: CGFloat = 100
static let avatarH: CGFloat = 100
static let headerW: CGFloat = headerH * headerScale
static let headerH: CGFloat = 150
static let previewW: CGFloat = previewH * previewScale
static let previewH: CGFloat = 200
}
struct Cookie {
static var null = "null"
static var expired = "expired"
static var mystery = "mystery"
static let null = "null"
static let expired = "expired"
static let mystery = "mystery"

static var igneous = "igneous"
static var ipbMemberId = "ipb_member_id"
static var ipbPassHash = "ipb_pass_hash"
static let igneous = "igneous"
static let ipbMemberId = "ipb_member_id"
static let ipbPassHash = "ipb_pass_hash"
}
struct DateFormat {
static var publish = "yyyy-MM-dd HH:mm"
static var torrent = "yyyy-MM-dd HH:mm"
static var comment = "dd MMMM yyyy, HH:mm"
static let publish = "yyyy-MM-dd HH:mm"
static let torrent = "yyyy-MM-dd HH:mm"
static let comment = "dd MMMM yyyy, HH:mm"
}
struct FilePath {
static let logs = "logs"
static let ehpandaLog = "EhPanda.log"
}
struct Response {
static var hathClientNotFound = "You must have a H@H client assigned to your account to use this feature."
static var hathClientNotOnline = "Your H@H client appears to be offline. Turn it on, then try again."
static var invalidResolution = "The requested gallery cannot be downloaded with the selected resolution."
static let hathClientNotFound = "You must have a H@H client assigned to your account to use this feature."
static let hathClientNotOnline = "Your H@H client appears to be offline. Turn it on, then try again."
static let invalidResolution = "The requested gallery cannot be downloaded with the selected resolution."
}
struct URL {
// Domains
Expand Down
12 changes: 7 additions & 5 deletions EhPanda/App/EhPandaApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,15 @@ private extension EhPandaApp {
#endif
}
func configure(file: inout FileDestination) {
file.logFileAmount = 5
file.logFileURL = try? FileManager.default.url(
for: .documentDirectory, in: .userDomainMask,
appropriateFor: nil, create: true
).appendingPathComponent("EhPanda.log")
file.calendar = Calendar(identifier: .gregorian)
file.logFileAmount = 10
file.logFileURL = logsDirectoryURL?
.appendingPathComponent(
Defaults.FilePath.ehpandaLog
)
}
func configure(console: inout ConsoleDestination) {
console.calendar = Calendar(identifier: .gregorian)
#if DEBUG
console.asynchronously = false
#endif
Expand Down
29 changes: 29 additions & 0 deletions EhPanda/App/Utility.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ func notificFeedback(style: UINotificationFeedbackGenerator.FeedbackType) {
var animatedTransition: AnyTransition {
AnyTransition.opacity.animation(.default)
}
var logsDirectoryURL: URL? {
try? FileManager.default.url(
for: .documentDirectory, in: .userDomainMask,
appropriateFor: nil, create: true
)
.appendingPathComponent(Defaults.FilePath.logs)
}
func clearPasteboard() {
UIPasteboard.general.string = ""
}
Expand Down Expand Up @@ -246,6 +253,28 @@ func dispatchMainSync(execute work: () -> Void) {
}
}

func presentActivityVC(items: [Any]) {
let activityVC = UIActivityViewController(
activityItems: items,
applicationActivities: nil
)
if isPad {
activityVC.popoverPresentationController?.sourceView = keyWindow
activityVC.popoverPresentationController?.sourceRect = CGRect(
x: screenW, y: 0,
width: 200, height: 200
)
}
activityVC.modalPresentationStyle = .overFullScreen
keyWindow?.rootViewController?
.present(
activityVC,
animated: true,
completion: nil
)
impactFeedback(style: .light)
}

// MARK: UserDefaults
let isDebugModeOn = UserDefaults.standard.bool(forKey: "debugModeOn")

Expand Down
5 changes: 5 additions & 0 deletions EhPanda/App/ja.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@
"Website" = "ウェブサイト";
"Acknowledgement" = "謝辞";

// MARK: LogsView
"Logs" = "ログ";
"Latest" = "最新";
" records" = "件レコード";

// MARK: FilterView
"Filters" = "フィルター";
"Basic" = "基本";
Expand Down
5 changes: 5 additions & 0 deletions EhPanda/App/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@
"Website" = "网站";
"Acknowledgement" = "致谢";

// MARK: LogsView
"Logs" = "日志";
"Latest" = "最新";
" records" = "条记录";

// MARK: FilterView
"Filters" = "筛选";
"Basic" = "基础";
Expand Down
5 changes: 5 additions & 0 deletions EhPanda/App/zh-Hant.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@
"Website" = "網站";
"Acknowledgement" = "致謝";

// MARK: LogsView
"Logs" = "日誌";
"Latest" = "最新";
" records" = "條紀錄";

// MARK: FilterView
"Filters" = "篩選";
"Basic" = "基本";
Expand Down
12 changes: 11 additions & 1 deletion EhPanda/Models/Manga.swift → EhPanda/Models/Models.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Manga.swift
// Models.swift
// EhPanda
//
// Created by 荒木辰造 on R 2/11/22.
Expand Down Expand Up @@ -204,6 +204,16 @@ struct MangaTorrent: Identifiable, Codable {
let magnet: String
}

struct Log: Identifiable, Comparable {
static func < (lhs: Log, rhs: Log) -> Bool {
lhs.fileName < rhs.fileName
}

var id: String { fileName }
let fileName: String
let contents: [String]
}

// MARK: Computed Properties
extension Manga: DateFormattable, CustomStringConvertible {
var description: String {
Expand Down
2 changes: 2 additions & 0 deletions EhPanda/View/Content/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ struct ContentView: View, StoreAccessor {
.onAppear {
onWebImageAppear(item: item)
}
#if DEBUG
Text("\(item.tag + 1)/\(mangaDetail?.pageCount ?? "")")
.bold().font(.largeTitle).foregroundColor(.gray)
#endif
}
}
LoadMoreFooter(
Expand Down
Loading

0 comments on commit a931e42

Please sign in to comment.