-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
docs: add slskd example to readme #139
base: master
Are you sure you want to change the base?
Conversation
read -t5 -r line | ||
path=$(echo "$line" | awk -F'"localDirectoryName":"' '{print $2}' | awk -F'"' '{print $1}' | awk '{printf "%s", $0}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i haven't tested, but would this work? just incase a filename has quotes in it
read -t5 -r line | |
path=$(echo "$line" | awk -F'"localDirectoryName":"' '{print $2}' | awk -F'"' '{print $1}' | awk '{printf "%s", $0}') | |
path="$(jq -r ".localDirectoryName")" |
no need for read
either since jq will receive stdin
might need to add jq to the docker image too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, it looks like the json comes as an argument to the script, not stdin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a lot of trial and error to make it work using only the tools included in the official docker image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, but I think adding jq as a dependency here https://github.com/sentriz/betanin/blob/master/Dockerfile#L38 would be fine. i think it's worth it to parse the json properly incase the directory path includes special chars like "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think adding jq to the betanin docker image would help ^^
(the script is run by slskd)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could make a pr on the slskd Dockerfile : https://github.com/slskd/slskd/blob/master/Dockerfile
But I don't know if it would be accepted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahhaha oh yes, you're right, ofc 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slskd recently allowed to run a script whenever a directory download is completed. The implementation is quite basic but it works nicely with betanin.