summaryrefslogtreecommitdiff
path: root/rmpc/increment_play_count
diff options
context:
space:
mode:
Diffstat (limited to 'rmpc/increment_play_count')
-rwxr-xr-xrmpc/increment_play_count8
1 files changed, 8 insertions, 0 deletions
diff --git a/rmpc/increment_play_count b/rmpc/increment_play_count
new file mode 100755
index 0000000..6fa8570
--- /dev/null
+++ b/rmpc/increment_play_count
@@ -0,0 +1,8 @@
+#!/usr/bin/env sh
+
+sticker=$(rmpc sticker get "$FILE" "playCount" | jq -r '.value')
+if [ -z "$sticker" ]; then
+ rmpc sticker set "$FILE" "playCount" "1"
+else
+ rmpc sticker set "$FILE" "playCount" "$((sticker + 1))"
+fi