...
 
Commits (307)

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -5,3 +5,4 @@ cover/
*.egg-info/
dist/
build/
test-res/
\ No newline at end of file
stages:
- mirror
- test
- stats
- release
default:
image: namboy94/ci-docker-environment:0.8.0
before_script:
- echo "$SERVER_ACCESS_KEY" > ~/.ssh/id_rsa
- chmod 0600 ~/.ssh/id_rsa
# TODO Remove this once development stabilizes
- git clone https://gitlab.namibsun.net/namibsun/python/puffotter -b develop
- cd puffotter
- python setup.py install
- cd ..
- rm -rf puffotter
github_mirror:
stage: mirror
tags: [docker]
only: [master, develop]
before_script:
- echo "$GITHUB_SSH_KEY" > ~/.ssh/id_rsa
- chmod 0600 ~/.ssh/id_rsa
script:
- git-mirror-pusher git@github.com:namboy94/toktokkie.git
master develop
stylecheck:
stage: test
tags:
- python3
tags: [docker]
script:
- python3 -m venv virtual && source virtual/bin/activate && pip install ci-scripts
- python-codestyle-check
- python-codestyle-check --exclude toktokkie/gui/pyuic
type_check:
stage: test
tags: [docker]
script:
- python-static-type-check
unittest:
stage: test
tags:
- python3
- progstats
tags: [docker]
script:
- python3 -m venv virtual && source virtual/bin/activate && pip install ci-scripts
- pip install PyQt5
- python-unittest
gitstats:
stage: stats
tags: [docker]
script:
- gitstats-gen
docgen:
stage: stats
tags: [docker]
script:
- pip install PyQt5
- sphinx-docgen
release_upload:
stage: release
only:
- master
tags:
- python3
only: [master]
tags: [docker]
script:
- python3 -m venv virtual && source virtual/bin/activate && pip install ci-scripts
- github-release-upload $(cat version) "$(changelog-reader)"
- gitlab-release-upload $(cat version) "$(changelog-reader)"
pypi_upload:
stage: release
only:
- master
tags:
- python3
only: [master]
tags: [docker]
script:
- python3 -m venv virtual && source virtual/bin/activate && pip install ci-scripts
- pypi-upload
gitstats:
stage: stats
tags:
- python3
- gitstats
- progstats
script:
- python3 -m venv virtual && source virtual/bin/activate && pip install ci-scripts
- gitstats-gen
docgen:
stage: stats
tags:
- python3
- progstats
script:
- python3 -m venv virtual && source virtual/bin/activate && pip install ci-scripts
- sphinx-docgen
V 0.18.0:
- Redid metadata to be more minimalistic and easier to maintain
- Substituted verification for Checkers
- Is now more opinionated, removed options for renaming schemes
- Added CLI tools for adding multi-episodes and excludes
- Implemented toktokkie-supercut tool
- Implemented manga, light novel and visual novel support
- Renamer now supports renaming titles for series with anilist IDs
V 0.17.0:
- Added verification mechanisms
- Added unit tests for metadata and verification
V 0.16.1:
- Removed __init__ file in bin
V 0.16.0:
......
# Tok Tokkie Media Manager
# toktokkie
|master|develop|
|:----:|:-----:|
......@@ -6,7 +6,32 @@
![Logo](resources/logo/logo-readme.png)
A collection of command-line media managing tools
The toktokkie media manager consists of a collection of command-line tools used
for keeping track of media.
Currently, the following media types are supported:
- Book
- Book Series
- Movie
- TV Series
- Manga
- Visual Novels
## Structure
The metadata for a Media directory is stored inside the ```.meta```
subdirectory in a file called ```info.json```. Additionally, folder icons may
be stored in ```.meta/icons```. Depending on the metadata type, additional
special folder may exist.
## Generating and modifying metadata
To generate metadata for a media directory, run
```toktokkie metadata-gen <media_type> <directories...>```
Metadata can be modified using a text editor or the ```toktokkie metadata-add```
utility.
## Further Information
......
#!/usr/bin/env python
"""LICENSE
Copyright 2015 Hermann Krumrey <hermann@krumreyh.com>
......@@ -20,40 +18,45 @@ along with toktokkie. If not, see <http://www.gnu.org/licenses/>.
LICENSE"""
import argparse
from toktokkie import Directory
from toktokkie.metadata import metadata_types
from puffotter.init import cli_start, argparse_add_verbosity
from toktokkie import sentry_dsn
from toktokkie.scripts import toktokkie_commands
def main():
def main(args: argparse.Namespace):
"""
The toktokkie-metadata-gen main method
The main function of this script
:param args: The command line arguments
:return: None
"""
media_types = list(map(lambda x: x.type, metadata_types))
for command_cls in toktokkie_commands:
if command_cls.name() == args.command:
command = command_cls(args)
command.execute()
parser = argparse.ArgumentParser()
parser.add_argument("directory",
help="The directory for which to generate "
"a metadata file for")
parser.add_argument("media_type", choices=set(media_types),
help="The media type of the metadata")
args = parser.parse_args()
directory = args.directory
if directory.endswith("/"):
directory = directory.rsplit("/", 1)[0]
def define_parser() -> argparse.ArgumentParser:
"""
:return: The command line parser for this script
"""
parser = argparse.ArgumentParser()
argparse_add_verbosity(parser)
command_parser = parser.add_subparsers(required=True, dest="command")
media_type = args.media_type
metadata_class = list(filter(
lambda x: x.type == media_type,
metadata_types
))[0]
for command_cls in toktokkie_commands:
subparser = command_parser.add_parser(command_cls.name())
argparse_add_verbosity(subparser)
command_cls.prepare_parser(subparser)
Directory(directory, True, metadata_class)
return parser
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print("Thanks for using toktokkie!")
cli_start(
main,
define_parser(),
"Thanks for using toktokkie!",
"toktokkie",
sentry_dsn
)
This diff is collapsed.
#!/usr/bin/env python
"""LICENSE
Copyright 2015 Hermann Krumrey <hermann@krumreyh.com>
This file is part of toktokkie.
toktokkie is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
toktokkie is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with toktokkie. If not, see <http://www.gnu.org/licenses/>.
LICENSE"""
import argparse
from toktokkie.renaming import schemes, agents, Plex, TVDB
from toktokkie import Directory
def main():
"""
The toktokkie-rename main method
:return: None
"""
naming_schemes = list(map(lambda x: x.name, schemes))
naming_agents = list(map(lambda x: x.name, agents))
default_scheme = Plex.name
default_agent = TVDB.name
parser = argparse.ArgumentParser()
parser.add_argument("directories", nargs="+",
help="The directories to rename. "
"Files and directories that do not contain any "
"valid metadata configuration will be ignored.")
parser.add_argument("scheme", choices=set(naming_schemes), nargs="?",
default=default_scheme,
help="The naming scheme to use")
parser.add_argument("agent", choices=set(naming_agents), nargs="?",
default=default_agent,
help="The episode data fetching agent to use")
parser.add_argument("--noconfirm", action="store",
help="Skips the user confirmation step")
args = parser.parse_args()
directories = args.directories
scheme = list(filter(lambda x: x.name == args.scheme, schemes))[0]
agent = list(filter(lambda x: x.name == args.agent, agents))[0]
for path in directories:
try:
directory = Directory(path)
directory.rename(scheme, agent, args.noconfirm)
except ValueError:
print("Renaming of " + path + "failed")
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print("Thanks for using toktokkie!")
#!/usr/bin/env python
"""LICENSE
Copyright 2015 Hermann Krumrey <hermann@krumreyh.com>
This file is part of toktokkie.
toktokkie is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
toktokkie is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with toktokkie. If not, see <http://www.gnu.org/licenses/>.
LICENSE"""
import argparse
from xdcc_dl.helper import set_throttle_value
from toktokkie.renaming import schemes, agents, Plex, TVDB
from toktokkie import Directory
from toktokkie.exceptions import MissingMetadataException, \
MissingUpdateInstructionsException
def main():
"""
The toktokkie-xdcc-update main method
:return: None
"""
naming_schemes = list(map(lambda x: x.name, schemes))
naming_agents = list(map(lambda x: x.name, agents))
default_scheme = Plex.name
default_agent = TVDB.name
parser = argparse.ArgumentParser()
parser.add_argument("directories", nargs="+",
help="The directories to xdcc-update. "
"Files and directories that do not contain any "
"valid metadata configuration will be ignored.")
parser.add_argument("scheme", choices=set(naming_schemes), nargs="?",
default=default_scheme,
help="The naming scheme to use")
parser.add_argument("agent", choices=set(naming_agents), nargs="?",
default=default_agent,
help="The episode data fetching agent to use")
parser.add_argument("-c", "--create", action="store_true",
help="If set, will prompt for information and create "
"new xdcc update instructions")
parser.add_argument("-t", "--throttle",
help="Sets a speed at which to throttle the download")
args = parser.parse_args()
directories = args.directories
scheme = list(filter(lambda x: x.name == args.scheme, schemes))[0]
agent = list(filter(lambda x: x.name == args.agent, agents))[0]
set_throttle_value(args.throttle)
for path in directories:
try:
directory = Directory(path)
print(directory.metadata.name)
if args.create:
directory.xdcc_update(scheme, agents, True)
else:
directory.xdcc_update(scheme, agent)
except ValueError as e:
print(e)
print("Updating of " + path + "failed")
raise e
except MissingMetadataException:
print("Missing metadata: " + path)
except MissingUpdateInstructionsException:
print("Missing update instructions. Run with --create first")
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print("Thanks for using toktokkie!")
list | data
list only:
- check relations
- if not completed and not done:
if "cantfind" in tags:
skip
else:
error
- check start/end dates
- check score
both:
- for entry in list: check if ID in data
- for item in data:
for season in item:
check episode counts.
\ No newline at end of file
#!/bin/env python
"""LICENSE
Copyright 2019 Hermann Krumrey <hermann@krumreyh.com>
This file is part of toktokkie.
toktokkie is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
toktokkie is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with toktokkie-gui. If not, see <http://www.gnu.org/licenses/>.
LICENSE"""
import os
from subprocess import check_output
qt_designer_dir = os.path.join("toktokkie", "gui", "qt_designer")
pyuic_dir = os.path.join("toktokkie", "gui", "pyuic")
for design in os.listdir(qt_designer_dir):
if design.endswith(".ui"):
design_file = os.path.join(qt_designer_dir, design)
result_file = os.path.join(pyuic_dir, design.replace(".ui", ".py"))
generated = check_output(["pyuic5", design_file])
with open(result_file, "wb") as f:
f.write(generated)
......@@ -44,8 +44,16 @@ if __name__ == "__main__":
"requests",
"xdcc_dl",
"colorama",