diff --git a/Makefile b/Makefile index 97f44bd..85fbd49 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/docs/content/installation.md b/docs/content/01-installation.md similarity index 89% rename from docs/content/installation.md rename to docs/content/01-installation.md index 20810fc..63f6287 100644 --- a/docs/content/installation.md +++ b/docs/content/01-installation.md @@ -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 diff --git a/docs/content/02-configuration.md b/docs/content/02-configuration.md new file mode 100644 index 0000000..517c9ae --- /dev/null +++ b/docs/content/02-configuration.md @@ -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`. \ No newline at end of file diff --git a/docs/content/03-subtitles.md b/docs/content/03-subtitles.md new file mode 100644 index 0000000..7980861 --- /dev/null +++ b/docs/content/03-subtitles.md @@ -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 +``` \ No newline at end of file diff --git a/docs/content/04-renaming.md b/docs/content/04-renaming.md new file mode 100644 index 0000000..b1de4fd --- /dev/null +++ b/docs/content/04-renaming.md @@ -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 +``` \ No newline at end of file diff --git a/etc/supper.yaml b/etc/supper.yaml index 0c468b1..810256a 100644 --- a/etc/supper.yaml +++ b/etc/supper.yaml @@ -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