Code Monkey home page Code Monkey logo

scenery's Introduction

Scenery.app icon

Scenery

Build Status codecov Codacy Badge PyPI version

A command-line tool that automates renaming of so-called "Scene Release" files by fetching episode names (from TVMaze) and which uses pattern-based generic building blocks (show name, season number, episode number, episode title) to format the output.

Essentially, a Python-based port of Scenery.app which was originally available exclusively for macOS.

The intended goal of this port is to be compatible with more platforms, including NASes. (e.g. WD My Cloud Mirror Gen 2).

Installation

Using pip (cross-platform)

Almost all systems running Python have pip. On those systems, installation is as easy as:

pip install scenery

On WD My Cloud Mirror Gen 2

  1. Download a precompiled binary from the releases page (e.g. WDMyCloudMirrorGen2_scenery_1.0.0.bin(18022019))
  2. Log into the WD My Cloud Mirror admin interface of your device
  3. Click "Apps"
  4. Click "Install an app manually"
  5. Choose the binary you downloaded previously
  6. Wait for the confirmation

⚠️ This will only install the command-line utility. You'll still have to ssh into the device to use it!

Usage

usage: scenery [-h] [-p PATTERN] [-s] [-e] [-o] [-d] [-v] [-f] path

positional arguments:
  path                  Which path to process.
                        If a directory is given, it's scanned recursively and all files are processed.
                        If a file is given, only it is processed.

optional arguments:
  -p PATTERN, --pattern PATTERN
                        Output format pattern. Syntax:
                            %a - Show name,
                            %s - Season #,
                            %n - Season #,
                            %t - Episode title
                        (default: "%a S%sE%n %t")
  -s, --season-zeroes   Leading zeroes in season numbers
  -e, --episode-zeroes  Leading zeroes in episode numbers
  -o, --overwrite       Overwrite existing target files
  -d, --dry-run         Do not do the actual renaming, but just show what
                        would happen instead
  -v, --verbose         Output successful actions as well
  -f, --force           Rename files even if the show name couldn't be
                        resolved

Developer notes

The project has been implemented in Python 2 to be compatible with a fairly outdated NAS that is running it. Minimum effort has been done to make this project run on Python 3 (using six).

For the main part of the codebase, PyBuilder is used to do analysis (flake8, coverage), run the tests tests and bundle the package.

git clone https://github.com/dachaz/scenery
cd scenery
pyb

The NAS-specific part of the codebase is in the wdc folder.

To compile a binary that My Cloud OS3-based NAS will want to install, it needs to be packaged with mksapkg. Since this is a proprietary WD binary, I'm not allowed to include it in the codebase. Furthermore, mksapkg has a bunch of platform-specific dependencies that my machine didn't meet, so I bundled all of them in a Docker image, including a step that downloads mksapkg from WDC. Thus, to build a binary of scenery that will run on your NAS, you just need to have Docker running and run:

./wdc/build.sh

To understand the full building process of a My Cloud OS3 binary, please refer to My Cloud OS3 SDK.

License

Copyright © 2019-2020 Dachaz. This software is licensed under the MIT License.

scenery's People

Contributors

dachaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.