Skip to content

Commit 4720dee

Browse files
committed
Merge branch 'refs/heads/1.10'
2 parents 30ed58c + 8ce5e19 commit 4720dee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+714
-592
lines changed

.flake8

-17
This file was deleted.

.github/workflows/python-app.yml

+18-21
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
1-
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3-
41
name: Python application
52

63
on:
74
push:
8-
branches: [ "master", "1.10", "dev_1.9", "dev_1.10"]
5+
branches: [ "master", "1.10", "1.9", "dev_1.10", "dev_1.9"]
96
pull_request:
10-
branches: [ "master", "1.10", "dev_1.9", "dev_1.10"]
7+
branches: [ "master", "1.10", "1.9", "dev_1.10", "dev_1.9"]
118

129
permissions:
1310
contents: read
1411

1512
jobs:
16-
build:
17-
13+
flake8-test:
1814
runs-on: ubuntu-latest
15+
container: python:3.11
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Install dependencies
19+
run: pip install -r requirements/test.txt
20+
- name: Check code formatting with flake8
21+
run: flake8 ./
1922

23+
black-test:
24+
runs-on: ubuntu-latest
25+
container: python:3.11
2026
steps:
21-
- uses: actions/checkout@v3
22-
- name: Set up Python 3.11
23-
uses: actions/setup-python@v3
24-
with:
25-
python-version: "3.11"
26-
- name: Install dependencies
27-
run: |
28-
python -m pip install --upgrade pip
29-
# pip install flake8 pytest
30-
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31-
- name: Lint with flake8
32-
run: |
33-
pip install -r requirements/test.txt
34-
flake8 . --config=.flake8
27+
- uses: actions/checkout@v3
28+
- name: Install dependencies
29+
run: pip install black
30+
- name: Check code formatting with black
31+
run: black ./ --check --verbose --diff

main.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
from http.server import HTTPServer
55
from pathlib import Path
66
from threading import Thread as PyThread
7+
78
import darkdetect
89
import platformdirs
9-
from PySide6.QtCore import Qt, QTranslator, QLocale, QThreadPool
10-
from PySide6.QtGui import QIcon, QPalette
10+
from PySide6.QtCore import QLocale, Qt, QThreadPool, QTranslator
11+
from PySide6.QtGui import QIcon
1112
from PySide6.QtWidgets import QApplication
12-
from qfluentwidgets import setTheme, Theme, InfoBar
13+
from qfluentwidgets import InfoBar, setTheme, Theme
1314

1415
from nlightreader import ParentWindow
15-
from nlightreader.consts.app import APP_VERSION, APP_NAME, APP_BRANCH
16+
from nlightreader.consts.app import APP_BRANCH, APP_NAME, APP_VERSION
1617
from nlightreader.consts.files import Icons
1718
from nlightreader.consts.urls import GITHUB_REPO
18-
from nlightreader.utils import get_locale, Thread, get_html, translate
19+
from nlightreader.utils import get_html, get_locale, Thread, translate
1920
from nlightreader.utils.kodik_server import KodikHTTPRequestHandler
2021

2122

@@ -118,7 +119,9 @@ def closeEvent(self, event):
118119
if __name__ == "__main__":
119120
if "debug" in sys.argv:
120121
logging.basicConfig(
121-
level=logging.WARNING, filename="latest.log", filemode="w",
122+
level=logging.WARNING,
123+
filename="latest.log",
124+
filemode="w",
122125
)
123126

124127
QApplication.setHighDpiScaleFactorRoundingPolicy(

make_version_file.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pyinstaller_versionfile
22

3-
from nlightreader.consts.app import APP_VERSION, APP_NAME
3+
from nlightreader.consts.app import APP_NAME, APP_VERSION
44

55
pyinstaller_versionfile.create_versionfile(
66
output_file="pkg_res/version_info.txt",

nlightreader/consts/files/files.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from enum import Enum
22

3-
from qfluentwidgets import FluentIconBase, Theme, getIconColor
3+
from qfluentwidgets import FluentIconBase, getIconColor, Theme
44

55
import nlight_res_rc
66

@@ -23,7 +23,7 @@ class Icons:
2323

2424

2525
class NlFluentIcons(FluentIconBase, Enum):
26-
""" Custom icons """
26+
"""Custom icons"""
2727

2828
SHIKIMORI = "shikimori"
2929

nlightreader/consts/items/anilib_items.py

+15-30
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,27 @@
99

1010
class AniLibItems(LibBaseItems):
1111
ORDERS = [
12-
{"value": None}
13-
| Po.POPULARITY,
14-
{"value": "rate_avg"}
15-
| Po.RATING,
16-
{"value": "views"}
17-
| Po.VIEWS,
18-
{"value": "episodes_count"}
19-
| Po.EPISODES_COUNT,
20-
{"value": "releaseDate"}
21-
| Po.AIRED_ON,
22-
{"value": "last_episode_at"}
23-
| Po.UPDATED,
24-
{"value": "created_at"}
25-
| Po.CREATED,
26-
{"value": "name"}
27-
| Po.NAME,
28-
{"value": "rus_name"}
29-
| Po.RUS_NAME,
12+
{"value": None} | Po.POPULARITY,
13+
{"value": "rate_avg"} | Po.RATING,
14+
{"value": "views"} | Po.VIEWS,
15+
{"value": "episodes_count"} | Po.EPISODES_COUNT,
16+
{"value": "releaseDate"} | Po.AIRED_ON,
17+
{"value": "last_episode_at"} | Po.UPDATED,
18+
{"value": "created_at"} | Po.CREATED,
19+
{"value": "name"} | Po.NAME,
20+
{"value": "rus_name"} | Po.RUS_NAME,
3021
]
3122

3223
KINDS = [
33-
{"value": 16}
34-
| Pk.TV,
35-
{"value": 17}
36-
| Pk.MOVIE,
24+
{"value": 16} | Pk.TV,
25+
{"value": 17} | Pk.MOVIE,
3726
{
3827
"value": 18,
3928
"name": "Short film",
4029
"russian": "Короткометражка",
4130
},
42-
{"value": 19}
43-
| Pk.SPECIAL,
44-
{"value": 20}
45-
| Pk.OVA,
46-
{"value": 21}
47-
| Pk.ONA,
48-
{"value": 22}
49-
| Pk.MUSIC,
31+
{"value": 19} | Pk.SPECIAL,
32+
{"value": 20} | Pk.OVA,
33+
{"value": 21} | Pk.ONA,
34+
{"value": 22} | Pk.MUSIC,
5035
]

nlightreader/consts/items/desu_items.py

+8-16
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,17 @@
99

1010
class DesuItems(ParserItems):
1111
ORDERS = [
12-
{"value": "popular"}
13-
| Po.POPULARITY,
14-
{"value": "name"}
15-
| Po.NAME,
16-
{"value": "updated"}
17-
| Po.UPDATED,
12+
{"value": "popular"} | Po.POPULARITY,
13+
{"value": "name"} | Po.NAME,
14+
{"value": "updated"} | Po.UPDATED,
1815
]
1916

2017
KINDS = [
21-
{"value": "manga"}
22-
| Pk.MANGA,
23-
{"value": "manhwa"}
24-
| Pk.MANHWA,
25-
{"value": "manhua"}
26-
| Pk.MANHUA,
27-
{"value": "one_shot"}
28-
| Pk.ONESHOT,
29-
{"value": "comics"}
30-
| Pk.COMIC,
18+
{"value": "manga"} | Pk.MANGA,
19+
{"value": "manhwa"} | Pk.MANHWA,
20+
{"value": "manhua"} | Pk.MANHUA,
21+
{"value": "one_shot"} | Pk.ONESHOT,
22+
{"value": "comics"} | Pk.COMIC,
3123
]
3224

3325
GENRES = [

nlightreader/consts/items/mangalib_items.py

+12-24
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,19 @@
99

1010
class MangaLibItems(LibBaseItems):
1111
ORDERS = [
12-
{"value": "rating_score"}
13-
| Po.RATING,
14-
{"value": "rate"}
15-
| Po.RATE_COUNT,
16-
{"value": "views"}
17-
| Po.VIEWS,
18-
{"value": "created_at"}
19-
| Po.CREATED,
20-
{"value": "last_chapter_at"}
21-
| Po.UPDATED,
22-
{"value": "chap_count"}
23-
| Po.CHAPTERS_COUNT,
12+
{"value": "rating_score"} | Po.RATING,
13+
{"value": "rate"} | Po.RATE_COUNT,
14+
{"value": "views"} | Po.VIEWS,
15+
{"value": "created_at"} | Po.CREATED,
16+
{"value": "last_chapter_at"} | Po.UPDATED,
17+
{"value": "chap_count"} | Po.CHAPTERS_COUNT,
2418
]
2519

2620
KINDS = [
27-
{"value": 1}
28-
| Pk.MANGA,
29-
{"value": 5}
30-
| Pk.MANHWA,
31-
{"value": 8}
32-
| Pk.RU_MANGA,
33-
{"value": 9}
34-
| Pk.WESTERN_COMIC,
35-
{"value": 4}
36-
| Pk.OEL_MANGA,
37-
{"value": 6}
38-
| Pk.MANHUA,
21+
{"value": 1} | Pk.MANGA,
22+
{"value": 5} | Pk.MANHWA,
23+
{"value": 8} | Pk.RU_MANGA,
24+
{"value": 9} | Pk.WESTERN_COMIC,
25+
{"value": 4} | Pk.OEL_MANGA,
26+
{"value": 6} | Pk.MANHUA,
3927
]

nlightreader/consts/items/ranobehub_items.py

+7-14
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,13 @@
88

99
class RanobehubItems(ParserItems):
1010
ORDERS = [
11-
{"value": ""}
12-
| Po.UPDATED,
13-
{"value": "created_at"}
14-
| Po.CREATED,
15-
{"value": "name_rus"}
16-
| Po.NAME,
17-
{"value": "views"}
18-
| Po.VIEWS,
19-
{"value": "computed_rating"}
20-
| Po.RATING,
21-
{"value": "count_chapters"}
22-
| Po.CHAPTERS_COUNT,
23-
{"value": "count_of_symbols"}
24-
| Po.TRANSLATION_VOLUME,
11+
{"value": ""} | Po.UPDATED,
12+
{"value": "created_at"} | Po.CREATED,
13+
{"value": "name_rus"} | Po.NAME,
14+
{"value": "views"} | Po.VIEWS,
15+
{"value": "computed_rating"} | Po.RATING,
16+
{"value": "count_chapters"} | Po.CHAPTERS_COUNT,
17+
{"value": "count_of_symbols"} | Po.TRANSLATION_VOLUME,
2518
]
2619

2720
GENRES = [

nlightreader/consts/items/ranobelib_items.py

+9-18
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,15 @@
88

99
class RanobeLibItems(LibBaseItems):
1010
ORDERS = [
11-
{"value": None}
12-
| Po.POPULARITY,
13-
{"value": "rate_avg"}
14-
| Po.RATING,
15-
{"value": "views"}
16-
| Po.VIEWS,
17-
{"value": "chap_count"}
18-
| Po.CHAPTERS_COUNT,
19-
{"value": "releaseDate"}
20-
| Po.AIRED_ON,
21-
{"value": "last_chapter_at"}
22-
| Po.UPDATED,
23-
{"value": "created_at"}
24-
| Po.CREATED,
25-
{"value": "name"}
26-
| Po.NAME,
27-
{"value": "rus_name"}
28-
| Po.RUS_NAME,
11+
{"value": None} | Po.POPULARITY,
12+
{"value": "rate_avg"} | Po.RATING,
13+
{"value": "views"} | Po.VIEWS,
14+
{"value": "chap_count"} | Po.CHAPTERS_COUNT,
15+
{"value": "releaseDate"} | Po.AIRED_ON,
16+
{"value": "last_chapter_at"} | Po.UPDATED,
17+
{"value": "created_at"} | Po.CREATED,
18+
{"value": "name"} | Po.NAME,
19+
{"value": "rus_name"} | Po.RUS_NAME,
2920
]
3021

3122
KINDS = [

nlightreader/consts/items/remanga_items.py

+14-28
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,21 @@
99

1010
class RemangaItems(ParserItems):
1111
ORDERS = [
12-
{"value": "-id"}
13-
| Po.CREATED,
14-
{"value": "-chapter_date"}
15-
| Po.UPDATED,
16-
{"value": "-rating"}
17-
| Po.POPULARITY,
18-
{"value": "-votes"}
19-
| Po.LIKES_NUM,
20-
{"value": "-views"}
21-
| Po.VIEWS,
22-
{"value": "-count_chapters"}
23-
| Po.CHAPTERS_COUNT,
24-
{"value": "-random"}
25-
| Po.RANDOM,
12+
{"value": "-id"} | Po.CREATED,
13+
{"value": "-chapter_date"} | Po.UPDATED,
14+
{"value": "-rating"} | Po.POPULARITY,
15+
{"value": "-votes"} | Po.LIKES_NUM,
16+
{"value": "-views"} | Po.VIEWS,
17+
{"value": "-count_chapters"} | Po.CHAPTERS_COUNT,
18+
{"value": "-random"} | Po.RANDOM,
2619
]
2720

2821
KINDS = [
29-
{"value": 0}
30-
| Pk.MANGA,
31-
{"value": 1}
32-
| Pk.MANHWA,
33-
{"value": 2}
34-
| Pk.MANHUA,
35-
{"value": 3}
36-
| Pk.WESTERN_COMIC,
37-
{"value": 4}
38-
| Pk.RU_COMIC,
39-
{"value": 5}
40-
| Pk.INDONESIAN_COMIC,
41-
{"value": 6}
42-
| Pk.OTHER,
22+
{"value": 0} | Pk.MANGA,
23+
{"value": 1} | Pk.MANHWA,
24+
{"value": 2} | Pk.MANHUA,
25+
{"value": 3} | Pk.WESTERN_COMIC,
26+
{"value": 4} | Pk.RU_COMIC,
27+
{"value": 5} | Pk.INDONESIAN_COMIC,
28+
{"value": 6} | Pk.OTHER,
4329
]

0 commit comments

Comments
 (0)