Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
TODO: fix sorting in anime library
  • Loading branch information
jmir1 committed Jun 27, 2021
2 parents cf4d6f0 + 6089014 commit 267b68b
Show file tree
Hide file tree
Showing 57 changed files with 873 additions and 504 deletions.
43 changes: 0 additions & 43 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

106 changes: 106 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: 🐞 Bug report
description: Report a bug in Aniyomi
labels: [Bug]
body:

- type: checkboxes
id: acknowledgements
attributes:
label: Acknowledgements
description: Read this carefully, we will close and ignore your issue if you skimmed through this.
options:
- label: I have searched the existing issues and this is a new ticket, **NOT** a duplicate or related to another open issue.
required: true
- label: I have written a short but informative title.
required: true
- label: If this is an issue with an extension, I should be opening an issue in the [extensions repository](https://github.com/jmir1/aniyomi-extensions/issues/new/choose).
required: true
- label: I have tried the [troubleshooting guide](https://tachiyomi.org/help/guides/troubleshooting/).
required: true
- label: I have updated the app to the **[latest version](https://github.com/jmir1/aniyomi/releases)**.
required: true
- label: I have updated all installed extensions.
required: true
- label: I will fill out all of the requested information in this form.
required: true

- type: input
id: aniyomi-version
attributes:
label: Aniyomi version
description: You can find your Aniyomi version in **More → About**.
placeholder: |
Example: "0.11.1.7"
validations:
required: true

- type: input
id: android-version
attributes:
label: Android version
description: You can find this somewhere in your Android settings.
placeholder: |
Example: "Android 11"
validations:
required: true

- type: input
id: device
attributes:
label: Device
description: List your device and model.
placeholder: |
Example: "Google Pixel 5"
validations:
required: true

- type: textarea
id: reproduce-steps
attributes:
label: Steps to reproduce
description: Provide an example of how to trigger the bug.
placeholder: |
Example:
1. First step
2. Second step
3. Bug occurs
validations:
required: true

- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
description: Explain what you should expect to happen.
placeholder: |
Example:
"This should happen..."
validations:
required: true

- type: textarea
id: actual-behavior
attributes:
label: Actual behavior
description: Explain what actually happens.
placeholder: |
Example:
"This happened instead..."
validations:
required: true

- type: textarea
id: crash-logs
attributes:
label: Crash logs
description: |
If you're experiencing crashes, share the crash logs from **More → Settings → Advanced** then press **Dump crash logs**.
placeholder: |
You can paste the crash logs in pure text or upload it as an attachment.
- type: textarea
id: other-details
attributes:
label: Other details
placeholder: |
Additional details and attachments.
11 changes: 7 additions & 4 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Aniyomi help discord
- name: ⚠️ Anime extension/source issue
url: https://github.com/jmir1/aniyomi-extensions/issues/new/choose
about: Issues and requests for extensions and sources should be opened in the aniyomi-extensions repository instead.
- name: 📦 Aniyomi extensions
url: https://github.com/jmir1/aniyomi-extensions
about: Anime extensions and sources.
- name: Aniyomi help discord
url: https://discord.gg/F32UjdJZrR
about: Common questions are answered here.
- name: Aniyomi extensions GitHub repository
url: https://github.com/jmir1/aniyomi-extensions
about: Issues about an anime extension/source/catalogue should be opened here instead.
29 changes: 0 additions & 29 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: ⭐ Feature request
description: Suggest a feature for Aniyomi
labels: [Feature request]
body:

- type: checkboxes
id: acknowledgements
attributes:
label: Acknowledgements
description: Read this carefully, we will close and ignore your issue if you skimmed through this.
options:
- label: I have searched the existing issues and this is a new ticket, **NOT** a duplicate or related to another open issue.
required: true
- label: I have written a short but informative title.
required: true
- label: If this is an issue with an extension, I should be opening an issue in the [extensions repository](https://github.com/jmir1/aniyomi-extensions/issues/new/choose).
required: true
- label: I have updated the app to the **[latest version](https://github.com/jmir1/aniyomi/releases)**.
required: true
- label: I will fill out all of the requested information in this form.
required: true

- type: textarea
id: feature-description
attributes:
label: Describe your suggested feature
description: How can an existing extension be improved?
placeholder: |
Example:
"It should work like this..."
validations:
required: true

- type: textarea
id: other-details
attributes:
label: Other details
placeholder: |
Additional details and attachments.
8 changes: 0 additions & 8 deletions .github/ISSUE_TEMPLATE/source_issue.md

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
build:
name: Build app
needs: check_wrapper
if: "!startsWith(github.event.head_commit.message, '[SKIP CI]')"
runs-on: ubuntu-latest

steps:
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/issue_closer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
rules: |
[
{
"type": "title",
"regex": ".*THIS ISSUE IS IN THE WRONG REPO.*",
"message": "It was not opened in the correct repo, as the template mentioned."
},
{
"type": "title",
"regex": ".*<Write short description here>*",
"message": "The description in the title was not filled out."
},
{
"type": "body",
"regex": ".*DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT.*",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue_moderator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Moderate issues
uses: tachiyomiorg/issue-moderator-action@v1.0
uses: tachiyomiorg/issue-moderator-action@v1.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ dependencies {
implementation("com.github.tachiyomiorg:subsampling-scale-image-view:846abe0") {
exclude(module = "image-decoder")
}
implementation("com.github.tachiyomiorg:image-decoder:ac5f65c")
implementation("com.github.tachiyomiorg:image-decoder:0e91111")

// Logging
implementation("com.jakewharton.timber:timber:4.7.1")
Expand Down
72 changes: 70 additions & 2 deletions app/src/main/java/eu/kanade/tachiyomi/Migrations.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import eu.kanade.tachiyomi.data.updater.UpdaterJob
import eu.kanade.tachiyomi.extension.AnimeExtensionUpdateJob
import eu.kanade.tachiyomi.extension.ExtensionUpdateJob
import eu.kanade.tachiyomi.network.PREF_DOH_CLOUDFLARE
import eu.kanade.tachiyomi.ui.animelib.AnimelibSort
import eu.kanade.tachiyomi.ui.library.LibrarySort
import eu.kanade.tachiyomi.ui.library.setting.SortDirectionSetting
import eu.kanade.tachiyomi.ui.library.setting.SortModeSetting
import eu.kanade.tachiyomi.ui.reader.setting.OrientationType
import eu.kanade.tachiyomi.util.system.toast
import eu.kanade.tachiyomi.widget.ExtendedNavigationView
Expand Down Expand Up @@ -100,9 +103,15 @@ object Migrations {
}
if (oldVersion < 44) {
// Reset sorting preference if using removed sort by source
val prefs = PreferenceManager.getDefaultSharedPreferences(context)

val oldSortingMode = prefs.getInt(PreferenceKeys.librarySortingMode, 0)

@Suppress("DEPRECATION")
if (preferences.librarySortingMode().get() == LibrarySort.SOURCE) {
preferences.librarySortingMode().set(LibrarySort.ALPHA)
if (oldSortingMode == LibrarySort.SOURCE) {
prefs.edit {
putInt(PreferenceKeys.librarySortingMode, LibrarySort.ALPHA)
}
}
}
if (oldVersion < 52) {
Expand Down Expand Up @@ -209,6 +218,65 @@ object Migrations {
LibraryUpdateJob.setupTask(context)
AnimelibUpdateJob.setupTask(context)
}
if (oldVersion < 64) {
val prefs = PreferenceManager.getDefaultSharedPreferences(context)

val oldSortingMode = prefs.getInt(PreferenceKeys.librarySortingMode, 0)
val oldSortingDirection = prefs.getBoolean(PreferenceKeys.librarySortingDirection, true)

@Suppress("DEPRECATION")
val newSortingMode = when (oldSortingMode) {
LibrarySort.ALPHA -> SortModeSetting.ALPHABETICAL
LibrarySort.LAST_READ -> SortModeSetting.LAST_READ
LibrarySort.LAST_CHECKED -> SortModeSetting.LAST_CHECKED
LibrarySort.UNREAD -> SortModeSetting.UNREAD
LibrarySort.TOTAL -> SortModeSetting.TOTAL_CHAPTERS
LibrarySort.LATEST_CHAPTER -> SortModeSetting.LATEST_CHAPTER
LibrarySort.CHAPTER_FETCH_DATE -> SortModeSetting.DATE_FETCHED
LibrarySort.DATE_ADDED -> SortModeSetting.DATE_ADDED
else -> SortModeSetting.ALPHABETICAL
}

val newSortingDirection = when (oldSortingDirection) {
true -> SortDirectionSetting.ASCENDING
else -> SortDirectionSetting.DESCENDING
}

val oldSortingModeAnime = prefs.getInt(PreferenceKeys.animelibSortingMode, 0)
val oldSortingDirectionAnime = prefs.getBoolean(PreferenceKeys.animelibSortingDirection, true)

@Suppress("DEPRECATION")
val newSortingModeAnime = when (oldSortingModeAnime) {
AnimelibSort.ALPHA -> SortModeSetting.ALPHABETICAL
AnimelibSort.LAST_READ -> SortModeSetting.LAST_READ
AnimelibSort.LAST_CHECKED -> SortModeSetting.LAST_CHECKED
AnimelibSort.UNREAD -> SortModeSetting.UNREAD
AnimelibSort.TOTAL -> SortModeSetting.TOTAL_CHAPTERS
AnimelibSort.LATEST_CHAPTER -> SortModeSetting.LATEST_CHAPTER
AnimelibSort.CHAPTER_FETCH_DATE -> SortModeSetting.DATE_FETCHED
AnimelibSort.DATE_ADDED -> SortModeSetting.DATE_ADDED
else -> SortModeSetting.ALPHABETICAL
}

val newSortingDirectionAnime = when (oldSortingDirectionAnime) {
true -> SortDirectionSetting.ASCENDING
else -> SortDirectionSetting.DESCENDING
}

prefs.edit(commit = true) {
remove(PreferenceKeys.librarySortingMode)
remove(PreferenceKeys.librarySortingDirection)
remove(PreferenceKeys.animelibSortingMode)
remove(PreferenceKeys.animelibSortingDirection)
}

prefs.edit {
putString(PreferenceKeys.librarySortingMode, newSortingMode.name)
putString(PreferenceKeys.librarySortingDirection, newSortingDirection.name)
putString(PreferenceKeys.animelibSortingMode, newSortingModeAnime.name)
putString(PreferenceKeys.animelibSortingDirection, newSortingDirectionAnime.name)
}
}
return true
}

Expand Down
Loading

0 comments on commit 267b68b

Please sign in to comment.