Skip to content

Commit

Permalink
docs: configuration, subs & renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
tympanix committed Mar 19, 2019
1 parent 0bf09fd commit e120aa0
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ docs:
rm -rf docs/public
git worktree prune
git worktree add docs/public gh-pages
git submodule update --recursive --remote
git submodule update --init --recursive
cd docs && hugo && cd ..

dist: clean build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ menu: true
weight: 1
---

Visit the [github releaes](https://github.com/tympanix/supper/releases) page for binaries
Visit the [github releaes](https://github.com/tympanix/supper/releases) page for binaries

## Linux
For debian based systems supper is available as a debian package. The package will install supper and set up a systemd unit for ease of use. Download the debian package from the github releaes page and install with
Expand Down
125 changes: 125 additions & 0 deletions docs/content/02-configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
---
title: Configuration
menu: true
weight: 2
---
Learn how to configure supper

You can specify the configuration of how supper function in a `.yaml` configuration file.
The configuration file can be located in different places according to operating system and precendence.
Here is an overview:

* Global configuration
- Unix: `/etc/supper/supper.yaml`
- Windows: `%HOMEPATH%\AppData\Roaming\Supper\supper.yaml`
* Local configuration
- `.supper.yaml` found in current working directory

The local configuration has precendence over the global configuration. If supper is run with
the `--config` argument, then that configuration file is used above all else.

## Example
Below the default configuration for supper is shown. Most of the configuration is
self-explanatory, however some details will be covered in the following sections.
```yaml
# Supper configuration file

# Satisfy the following languages when downloading subtitles
languages:
- en
- es
- de

# Path to store application logs
logfile: /var/log/supper/supper.log

# Download only hearing impaired subtitles
impared: false

# Bind web server to port
port: 5670

# Base path for reverse proxy
proxypath: "/"

# Movie collection configuration
movies:
# Directory to store movie collection
directory: /media/movies

# Template to use for renaming movies
template: >
{{ .Movie }} ({{ .Year }})/
{{ .Movie }} ({{ .Year }}) {{ .Quality }}
# TV show collection configuration
tvshows:
# Directory to store TV shows
directory: /media/tvshows

# Template to use for renaming TV shows
template: >
{{ .TVShow }}/Season {{ .Season | pad }}/
{{ .TVShow }} - S{{ .Season | pad }}E{{ .Episode | pad }} - {{ .Name }}
# Plugins are run after downloading a subtitle. The plugin is a simple shell
# command which is given the .srt file path in the SUBTITLE environment variable
plugins:
# - name: my-plugin-name
# exec: echo $SUBTITLE
```

## Templates
Templates are used to rename movie and TV series into folder/file names. The templating
scheme uses the golang templating language and is highly customizable. You may define
subfolders in your templating scheme using the path seperator `/`.

### Movies
The following directives are available for movie templates:

| Directive | Description | Example |
| :-------: | :-------------------------------: | :---------------: |
| `.Movie` | The name of the movie | `Inception` |
| `.Year` | The release year of the movie | `2010` |
| `.Quality` | Quality of the movie release | `720p` |
| `.Codec` | Codec of the movie release | `h264` |
| `.Source` | Source of the movie release | `BluRay` |
| `.Group` | Release group of the movie | N/A |

**Example:**
```handlebars
{{ .Movie }} ({{ .Year }})/{{ .Movie }} ({{ .Year }}) {{ .Quality }}
```


## TV shows
The following directovies are available for tv show templates:

| Directive | Description | Example |
| :-------: | :-------------------------------: | :---------------: |
| `.TVShow` | The name of the TV show | `Game of Thrones` |
| `.Name` | The name of the episode | `Pilot` |
| `.Season` | Season number | `1` |
| `.Episode` | Episode number | `1` |
| `.Quality` | Quality of the movie release | `720p` |
| `.Codec` | Codec of the movie release | `h264` |
| `.Source` | Source of the movie release | `BluRay` |
| `.Group` | Release group of the movie | N/A |

**Example:**
```handlebars
{{ .TVShow }}/Season {{ .Season | pad }}/
{{ .TVShow }} - S{{ .Season | pad }}E{{ .Episode | pad }} - {{ .Name }}
```

## Template Functions
You can utilize template functions to manipulate with the data in your templating schemes

#### `pad`
Pads the number with zeros to make up exactly two characters total. Useful for padding season and episode numbers.

**Example**
```handlebars
{{ .Season | pad }}
```
will output `01` for season one instead of just `1`.
25 changes: 25 additions & 0 deletions docs/content/03-subtitles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Subtitles
menu: true
weight: 3
---
How to download subtitles with supper

You can download subtitles with supper for individual files of whole directories easily

## Examples:
Download subtitles for all media in the `/media/movies` folder in english, german and spanish for files
added or modified in the last 24 hours:
```bash
supper sub -len -lde -les -m 24h /media/movies
```

Download english subtitles for the file `tvshow.mp4` if the subtitles has a score better than 75%:
```bash
supper sub -len -s 75 tvshow.mp4
```

Download and overwrite existing english subtitles for all media in `/media/tvshows`
```bash
supper sub -len --force /media/tvshows
```
24 changes: 24 additions & 0 deletions docs/content/04-renaming.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: Renaming
menu: true
weight: 4
---
How to rename and organize media

You can organize and rename individual files or whole directories with supper

### Examples:
Rename all media in the `/media/downloads` folder using hardlink (default action):
```bash
supper ren /media/downloads
```

Rename only movies in the `/media/downloads` folder using copy:
```bash
supper ren --action copy --movies /media/downloads
```

Rename all media in the `/media/downloads` folder and extract media from archives (rar/zip):
```bash
supper ren --extract /media/downloads
```
3 changes: 0 additions & 3 deletions etc/supper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ port: 5670
# Base path for reverse proxy
proxypath: "/"

# Location of web root for static resources
static: /var/lib/supper

# Movie collection configuration
movies:
# Directory to store movie collection
Expand Down

0 comments on commit e120aa0

Please sign in to comment.