Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added command on sync documentation #56

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions docs/extensions/commandonsync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: Run a Command on Sync
---

Run a predefined external command upon sync completion.

- [Extension Source](https://github.com/gpodder/gpodder/blob/master/share/gpodder/extensions/command_on_sync.py)


| setting | value | description | version |
|--------------------|------------|---------------------------------------------|-------------------|
| command | string | command to execute (passed to the shell) | git master branch |

Introduction
-----------

One might want to run an external program when all podcast episodes get synchronized to external database (refresh a player's database or enqueue the episode, download episode statistics, run other device-related program like Last.FM scrobbler, etc.). This extension makes it possible to execute any commad.
reactorcoremeltdown marked this conversation as resolved.
Show resolved Hide resolved

Usage
-----

1. In the Extensions tab under Preferences, check "Run a Command on Sync" (in the "Post Sync" section).
2. In the Advanced Configuration (**Edit Configuration** button), define the `extensions.command_on_sync.command`
entry to the command you want to run.

I advise you to write a wrapper script if the command is a bit long. You can also directly edit
`$GPODDER_HOME/Settings.json` to refine your command.
reactorcoremeltdown marked this conversation as resolved.
Show resolved Hide resolved

Example Commands
--------------

### Linux

```
zenity --info --width=600 --text="All episodes syncrhonized"
reactorcoremeltdown marked this conversation as resolved.
Show resolved Hide resolved
```

displays all variables in a dialog window (requires zenity).

### Scrobble playback log file to Last.FM (requires rb-scrobbler)

```
rb-scrobbler -f $SCROBBLER_LOG_FILE -n delete-on-success
```

You can obtain rb-scrobbler on [Github](https://github.com/jeselnik/rb-scrobbler).