Skip to content

Commit

Permalink
Merge develop - Update v.1.2.4-alpha
Browse files Browse the repository at this point in the history
# Added
Added CI actions
Added volume support
Added count support
Added localizedSeries

# Changed
If chapter is parsed (Ch.XX | Chapter XX | Chapter XX.X) force set number to parsed chapter
Updated unit tests
  • Loading branch information
ThePromidius authored Jun 3, 2022
2 parents f239927 + bb3727d commit 68f05c8
Show file tree
Hide file tree
Showing 13 changed files with 538 additions and 161 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/Run_Tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Python tests

on:
- push
- pull_request

jobs:
build:
# env:
# DISPLAY: ":99.0"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.8','3.9', ]
name: Python ${{ matrix.python-version }} sample
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- run: pip install -r requirements.txt
# - run: sudo apt install xvfb
# - name: Start xvfb
# run: |
# Xvfb :99 -screen 0 1920x1080x24 &disown
- name: Run the tests
run: python3 -m unittest discover -s tests -t .
32 changes: 26 additions & 6 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: ci

name: Build Docker
on:
push:
branches: [ main, develop ]
branches: [ main, develop , test ]

env:
IMAGE_NAME: "thepromidius/manga-tagger"
jobs:
docker_dev:
name: Build Nightly Docker if Develop push
docker_develop:
name: Nightly Build
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
steps:
Expand All @@ -26,7 +26,7 @@ jobs:
push: true
tags: ${{ env.IMAGE_NAME }}:nightly
docker_stable:
name: Build Stable Docker if Main push
name: Stable Build
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
steps:
Expand All @@ -48,3 +48,23 @@ jobs:
with:
push: true
tags: ${{ env.IMAGE_NAME }}:latest
docker_test:
name: Test Build
runs-on: ubuntu-latest
if: ${{github.ref == 'refs/heads/test' }}
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ env.IMAGE_NAME }}:test

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM ghcr.io/linuxserver/baseimage-alpine:3.13

LABEL \
maintainer="[email protected]"
maintainer="[email protected]"

### Set default Timezone, overwrite default MangaTagger settings for the container ###
ENV \
TZ="Europe/Paris" \
MANGA_TAGGER_DEBUG_MODE=false \
MANGA_TAGGER_DATA_DIR="/config/data" \
MANGA_TAGGER_IMAGE_COVER=true \
MANGA_TAGGER_IMAGE_COVER=false \
MANGA_TAGGER_IMAGE_DIR="/config/cover" \
MANGA_TAGGER_ADULT_RESULT=false \
MANGA_TAGGER_DOWNLOAD_DIR="/downloads" \
Expand Down
141 changes: 91 additions & 50 deletions MangaTaggerLib/MangaTaggerLib.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions MangaTaggerLib/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def search_details_by_series_id(cls, series_id, format, logging_info):
Media (id: $series_id, type: MANGA, format: $format) {
id
status
volumes
siteUrl
title {
romaji
Expand Down
7 changes: 7 additions & 0 deletions MangaTaggerLib/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ def _construct_api_metadata(self, anilist_details, logging_info):
self.series_title_jap = anilist_details['title']['native']

self.status = anilist_details['status']
if anilist_details.get('volumes'):
self.volumes = anilist_details.get('volumes')
else:
self.volumes = None

self.type = anilist_details['type']
self.description = anilist_details['description']
self.anilist_url = anilist_details['siteUrl']
Expand All @@ -64,6 +69,7 @@ def _construct_database_metadata(self, details):
self.series_title_eng = details['series_title_eng']
self.series_title_jap = details['series_title_jap']
self.status = details['status']
self.volumes = details.get("volumes")
self.type = details['type']
self.description = details['description']
self.anilist_url = details['anilist_url']
Expand Down Expand Up @@ -160,6 +166,7 @@ def test_value(self):
'series_title_eng': self.series_title_eng,
'series_title_jap': self.series_title_jap,
'status': self.status,
'volumes':self.volumes,
# 'mal_url': self.mal_url,
'anilist_url': self.anilist_url,
'publish_date': self.publish_date,
Expand Down
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[![mt-hub-img]][mt-hub-lnk]
[![Python tests](https://github.com/ThePromidius/Manga-Tagger/actions/workflows/Run_Tests.yml/badge.svg)](https://github.com/ThePromidius/Manga-Tagger/actions/workflows/Run_Tests.yml)
[![mt-hub-img]][mt-hub-lnk]

## <a href="https://github.com/Banh-Canh/Manga-Tagger">Banh-Canh/Manga-Tagger</a>
## <a href="https://github.com/Banh-Canh/Manga-Tagger">ThePromidius/Manga-Tagger</a>
## Descriptions

This fork doesn't require FMD2. Running MangaTagger.py will make it watch the directory configured in the settings.json.

Intended to be used in a docker container:
https://hub.docker.com/r/banhcanh/manga-tagger
https://hub.docker.com/r/thepromidius/manga-tagger

input Files still have to be named like this (they can be in their own %MANGA% directory, or not) : %MANGA% -.- %CHAPTER%.cbz
input Files still have to be named like this (they can be in their own %MANGA% directory, or not) : `%MANGA% -.- %CHAPTER%.cbz`

## Features:

Expand All @@ -21,6 +22,9 @@ input Files still have to be named like this (they can be in their own %MANGA% d
* Manga specific configuration

More infos:
Check the WIKI:
https://github.com/ThePromidius/Manga-Tagger/wiki

https://github.com/Inpacchi/Manga-Tagger

## Downloading and Running Manga-Tagger
Expand Down Expand Up @@ -49,7 +53,7 @@ python MangaTagger.py
version: "2.1"
services:
mangatagger:
image: banhcanh/manga-tagger
image: thepromidius/manga-tagger
container_name: mangatagger
environment:
- PUID=1000
Expand Down Expand Up @@ -109,9 +113,9 @@ services:
restart: unless-stopped
```
I recommend using this with my FMD2 docker image: https://hub.docker.com/r/banhcanh/docker-fmd2
I recommend using this banhcanh docker image: https://hub.docker.com/r/banhcanh/docker-fmd2
Environnement Variables overwrite the settings.json. In docker, it is only possible to configure with environnement variables.
Environment Variables overwrite the settings.json. In docker, it is only possible to configure with environment variables.
Enabling adult result may give wrong manga match. Make sure the input manga title is as accurate as possible if enabling this or it may confuse Anilist's search.
Expand All @@ -135,5 +139,6 @@ In this case, this title isn't accurate enough to search on Anilist and this why
[MIT](https://choosealicense.com/licenses/mit/)


[mt-hub-img]: https://img.shields.io/docker/pulls/banhcanh/manga-tagger.svg
[mt-hub-lnk]: https://hub.docker.com/r/banhcanh/manga-tagger
[mt-hub-img]: https://img.shields.io/docker/pulls/thepromidius/manga-tagger.svg
[mt-hub-lnk]: https://hub.docker.com/r/thepromidius/manga-tagger

1 change: 1 addition & 0 deletions tests/data/3D Kanojo Real Girl/data.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"id": 80767,
"status": "FINISHED",
"volumes": 12,
"siteUrl": "https://anilist.co/manga/80767",
"title": {
"romaji": "3D Kanojo: Real Girl",
Expand Down
Loading

0 comments on commit 68f05c8

Please sign in to comment.