summaryrefslogtreecommitdiff
path: root/rmpc/increment_play_count
diff options
context:
space:
mode:
authoranand <anand.panchdhari@gmail.com>2025-12-17 15:57:55 +0530
committeranand <anand.panchdhari@gmail.com>2025-12-17 15:57:55 +0530
commitb7ef29a8886a57aadb787807a7c6cf74c1f0ed3a (patch)
tree366a68240fbc9da6b1d567bd6c46d1350ad814de /rmpc/increment_play_count
Nixos
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