Skip to content

Commit

Permalink
Merge pull request #159 from tatsuz0u/develop
Browse files Browse the repository at this point in the history
Bugfix & Refactoring
  • Loading branch information
tatsuz0u committed Oct 4, 2021
2 parents 05aaccc + 68ee083 commit 28a0dc1
Show file tree
Hide file tree
Showing 16 changed files with 140 additions and 116 deletions.
4 changes: 2 additions & 2 deletions .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.0.app
APP_VERSION: '1.3.6'
APP_VERSION: '1.3.7'
SCHEME_NAME: 'EhPanda'
ALTSTORE_JSON_PATH: './AltStore.json'
BUILDS_PATH: '/tmp/action-builds'
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
ls ~/Library/MobileDevice/Provisioning\ Profiles
- name: Bump version
id: bump-version
uses: tatsuz0u/ios-bump-version@feature/outputs
uses: yanamura/ios-bump-version@v1
with:
version: ${{ env.APP_VERSION }}
- name: Xcode archive
Expand Down
28 changes: 28 additions & 0 deletions EhPanda/App/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,13 @@
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "watch",
"role" : "notificationCenter",
"scale" : "2x",
"size" : "33x33",
"subtype" : "45mm"
},
{
"filename" : "80.png",
"idiom" : "watch",
Expand All @@ -196,6 +203,13 @@
"size" : "44x44",
"subtype" : "40mm"
},
{
"idiom" : "watch",
"role" : "appLauncher",
"scale" : "2x",
"size" : "46x46",
"subtype" : "41mm"
},
{
"filename" : "100.png",
"idiom" : "watch",
Expand All @@ -204,6 +218,13 @@
"size" : "50x50",
"subtype" : "44mm"
},
{
"idiom" : "watch",
"role" : "appLauncher",
"scale" : "2x",
"size" : "51x51",
"subtype" : "45mm"
},
{
"filename" : "172.png",
"idiom" : "watch",
Expand All @@ -228,6 +249,13 @@
"size" : "108x108",
"subtype" : "44mm"
},
{
"idiom" : "watch",
"role" : "quickLook",
"scale" : "2x",
"size" : "117x117",
"subtype" : "45mm"
},
{
"filename" : "1024.png",
"idiom" : "watch-marketing",
Expand Down
15 changes: 3 additions & 12 deletions EhPanda/App/Defaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ struct Defaults {
static let ipbPassHash = "ipb_pass_hash"
}
struct DateFormat {
static let greeting = "dd MMMM yyyy"
static let publish = "yyyy-MM-dd HH:mm"
static let torrent = "yyyy-MM-dd HH:mm"
static let comment = "dd MMMM yyyy, HH:mm"
Expand Down Expand Up @@ -154,19 +155,9 @@ extension Defaults.URL {
if let pageNum = pageNum { params.append(page2 + String(pageNum)) }
return merge(urls: params + applyFilters(filter: filter))
}
static func moreSearchList(
keyword: String,
filter: Filter,
pageNum: Int,
lastID: String
) -> String {
static func moreSearchList(keyword: String, filter: Filter, pageNum: Int, lastID: String) -> String {
merge(
urls: [
host,
fSearch + keyword.urlEncoded(),
page2 + String(pageNum),
from + lastID
]
urls: [host, fSearch + keyword.urlEncoded(), page2 + String(pageNum), from + lastID]
+ applyFilters(filter: filter)
)
}
Expand Down
22 changes: 6 additions & 16 deletions EhPanda/App/Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -158,24 +158,14 @@ extension String {

var isValidURL: Bool {
if let detector = try? NSDataDetector(
types: NSTextCheckingResult
.CheckingType.link.rawValue
types: NSTextCheckingResult.CheckingType.link.rawValue
) {
if let match = detector.firstMatch(
in: self, options: [],
range: NSRange(
location: 0,
length: self.utf16.count
)
if let match = detector.firstMatch(in: self, options: [],
range: NSRange(location: 0, length: utf16.count)
) {
return match.range.length
== self.utf16.count
} else {
return false
}
} else {
return false
}
return match.range.length == utf16.count
} else { return false }
} else { return false }
}
}

Expand Down
2 changes: 1 addition & 1 deletion EhPanda/App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>zeng.EhPanda</string>
<string>app.ehpanda</string>
<key>CFBundleURLSchemes</key>
<array>
<string>ehpanda</string>
Expand Down
22 changes: 1 addition & 21 deletions EhPanda/App/Utility.swift
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ var absScreenH: CGFloat {
}

func impactFeedback(style: UIImpactFeedbackGenerator.FeedbackStyle) {
UIImpactFeedbackGenerator(style: style)
.impactOccurred()
UIImpactFeedbackGenerator(style: style).impactOccurred()
}
func notificFeedback(style: UINotificationFeedbackGenerator.FeedbackType) {
UINotificationFeedbackGenerator().notificationOccurred(style)
Expand Down Expand Up @@ -370,25 +369,6 @@ func readableUnit<I: BinaryInteger>(bytes: I) -> String {
return formatter.string(fromByteCount: Int64(bytes))
}

func browsingCaches() -> String {
guard let fileURL = FileManager
.default
.urls(
for: .cachesDirectory,
in: .userDomainMask
)
.first?
.appendingPathComponent(
"cachedList.json"
),
let data = try? Data(
contentsOf: fileURL
)
else { return "0 KB" }

return readableUnit(bytes: data.count)
}

// MARK: Cookies
func initializeCookieFrom(cookie: HTTPCookie, value: String) -> HTTPCookie {
var properties = cookie.properties
Expand Down
14 changes: 7 additions & 7 deletions EhPanda/App/ko.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@
// MARK: AlertView
"Loading..." = "로딩 중...";
"Login" = "로그인";
//"There seems to be nothing here." = "";
"There seems to be nothing here." = "여기가 아무도 없는 것 같습니다.";
"Retry" = "재시도";
"A network error occurred." = "인터넷 접속 오류가 발생했어요.";
"A parsing error occurred." = "구분 분석 오류가 발생했어요.";
"An unknown error occurred." = "알 수 없는 오류가 발생했어요.";
"Please try again later." = "잠시 후 다시 시도해 주세요.";
"This gallery has been removed or is unavailable." = "이 갤러리는 제거되었거나 사용할 수 없어요.";
"This gallery is unavailable due to a copyright claim by PLACEHOLDER. Sorry about that." = "PLACEHOLDER의 저작권 요청으로 인하여 이 갤러리를 사용할 수 없어요.";
//"Your IP address has been temporarily banned for excessive pageloads which indicates that you are using automated mirroring / harvesting software." = "";
//"The ban expires in PLACEHOLDER." = "";
"Your IP address has been temporarily banned for excessive pageloads which indicates that you are using automated mirroring / harvesting software." = "자동화된 미러링/수집 소프트웨어를 사용 중임을 나타내는 과도한 페이지 로드로 인해 IP 주소가 일시적으로 금지되었습니다.";
"The ban expires in PLACEHOLDER." = "금지효과는 PLACEHOLDER에서 만료되었습니다.";
"BAN_INTERVAL_AND" = " and ";
"BAN_INTERVAL_DAYS" = " days";
"BAN_INTERVAL_HOURS" = " hours";
"BAN_INTERVAL_MINUTES" = " minutes";
"BAN_INTERVAL_SECONDS" = " seconds";
//"Jump page" = "";
//"Confirm" = "";
"Jump page" = "페이지 이동";
"Confirm" = "확인";

// MARK: DetailView
"Archive" = "아카이브";
Expand Down Expand Up @@ -106,7 +106,7 @@
"Post" = "등록";

// MARK: ReadingView
//"AutoPlay" = "";
"AutoPlay" = "자동 재생";
"Reload" = "재시도";
"Copy" = "복사";
"Save" = "저장";
Expand Down Expand Up @@ -355,7 +355,7 @@
"GAINCONTENT_END" = "획득했어요!";

// MARK: QuickSearchView
//"Quick search" = "";
"Quick search" = "빠른 검색";

// MARK: HomeListType
"Search" = "검색";
Expand Down
2 changes: 1 addition & 1 deletion EhPanda/DataFlow/AppAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ enum AppAction {
case updateAppIconType(iconType: IconType)
case updateHistoryKeywords(text: String)
case clearHistoryKeywords
case updateSearchKeyword(text: String)
case updateLastKeyword(text: String)
case updateViewControllersCount
case updateSetting(setting: Setting)
case replaceGalleryCommentJumpID(gid: String?)
Expand Down
2 changes: 1 addition & 1 deletion EhPanda/DataFlow/AppState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ extension AppState {
extension AppState {
// MARK: HomeInfo
struct HomeInfo {
var searchKeyword = ""
var lastKeyword = ""

var searchItems = [Gallery]()
var searchLoading = false
Expand Down
4 changes: 2 additions & 2 deletions EhPanda/DataFlow/Store.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ final class Store: ObservableObject {
appState.homeInfo.insertHistoryKeyword(text: text)
case .clearHistoryKeywords:
appState.homeInfo.historyKeywords = []
case .updateSearchKeyword(let text):
appState.homeInfo.searchKeyword = text
case .updateLastKeyword(let text):
appState.homeInfo.lastKeyword = text
case .updateSetting(let setting):
appState.settings.setting = setting
case .updateViewControllersCount:
Expand Down
9 changes: 5 additions & 4 deletions EhPanda/View/Detail/AssociatedView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ struct AssociatedView: View, StoreAccessor {
GenericList(
items: associatedItems,
setting: setting,
pageNumber: pageNumber,
loadingFlag: loadingFlag,
loadError: loadError,
moreLoadingFlag: moreLoadingFlag,
Expand Down Expand Up @@ -89,8 +90,8 @@ struct AssociatedView: View, StoreAccessor {
.navigationBarTitle(title)
.onSubmit(of: .search, fetchAssociatedItems)
.onAppear(perform: fetchAssociatedItemsIfNeeded)
.onChange(of: pageNumber, perform: onPageNumberChanged)
.onChange(of: alertManager.isPresented, perform: onAlertVisibilityChanged)
.onChange(of: pageNumber, perform: onPageNumberChange)
.onChange(of: alertManager.isPresented, perform: onAlertVisibilityChange)
}
}

Expand All @@ -113,10 +114,10 @@ private extension AssociatedView {
fetchMoreAssociatedItems()
}
}
func onAlertVisibilityChanged(_: Bool) {
func onAlertVisibilityChange(_: Bool) {
isAlertFocused = false
}
func onPageNumberChanged(pageNumber: PageNumber) {
func onPageNumberChange(pageNumber: PageNumber) {
alertInput = String(pageNumber.current + 1)
}

Expand Down
4 changes: 2 additions & 2 deletions EhPanda/View/Detail/DetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct DetailView: View, StoreAccessor, PersistenceAccessor {
DescScrollView(gallery: gallery, detail: detail)
ActionRow(
detail: detail,
ratingAction: onUserRatingChanged,
ratingAction: onUserRatingChange,
galleryAction: onSimilarGalleryTap
)
if !galleryState.tags.isEmpty {
Expand Down Expand Up @@ -204,7 +204,7 @@ private extension DetailView {
guard let data = URL(string: gallery.galleryURL) else { return }
presentActivityVC(items: [data])
}
func onUserRatingChanged(value: Int) {
func onUserRatingChange(value: Int) {
store.dispatch(.rate(gid: gid, rating: value))
}
func detectAvailableNavigations() {
Expand Down
Loading

0 comments on commit 28a0dc1

Please sign in to comment.