{"action":"created","issue":{"url":"https://api.github.com/repos/aptalca/docker-rdp-calibre/issues/11","repository_url":"https://api.github.com/repos/aptalca/docker-rdp-calibre","labels_url":"https://api.github.com/repos/aptalca/docker-rdp-calibre/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/aptalca/docker-rdp-calibre/issues/11/comments","events_url":"https://api.github.com/repos/aptalca/docker-rdp-calibre/issues/11/events","html_url":"https://github.com/aptalca/docker-rdp-calibre/issues/11","id":148204242,"number":11,"title":"[Request] Add an Auto-Add feature.","user":{"login":"miketweaver","id":5581855,"avatar_url":"https://avatars.githubusercontent.com/u/5581855?v=3","gravatar_id":"","url":"https://api.github.com/users/miketweaver","html_url":"https://github.com/miketweaver","followers_url":"https://api.github.com/users/miketweaver/followers","following_url":"https://api.github.com/users/miketweaver/following{/other_user}","gists_url":"https://api.github.com/users/miketweaver/gists{/gist_id}","starred_url":"https://api.github.com/users/miketweaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miketweaver/subscriptions","organizations_url":"https://api.github.com/users/miketweaver/orgs","repos_url":"https://api.github.com/users/miketweaver/repos","events_url":"https://api.github.com/users/miketweaver/events{/privacy}","received_events_url":"https://api.github.com/users/miketweaver/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-13T22:46:58Z","updated_at":"2016-04-14T02:22:32Z","closed_at":null,"body":"I would like to request an \"auto add\" feature. Basically I'd like to be able to copy files to a folder on the Host machine (UnRaid) and have it automatically added to the Calibre library and database.\r\n\r\nThis can easily be done with cron.\r\nI've sort of made it work in your docker, but I didn't add cron to your docker. Right now I just use cron from UnRaid to run the script. \r\n(`* * * * * /usr/bin/docker exec -i 16c3f6638615 '/addnew.sh' > /dev/null 2>&1`)\r\n\r\nI created a new mountpoint and variable named `$TOADDPATH`\r\nThen this takes the files from the `$TOADDPATH` location, puts them into the database, and then copies them to `$LIBRARYINTERNALPATH`. It then removes everything in the `$TOADDPATH` location.\r\n\r\n/addnew.sh:\r\n``` bash\r\n#!/bin/bash\r\nif [ -z \"$TOADDPATH\" ]; then\r\n        echo \"Environmental Variable 'TOADDPATH' is empty. Skipping adding new books\"\r\nelse\r\n        /opt/calibre/calibredb add -r -1 $TOADDPATH --with-library=$LIBRARYINTERNALPATH\r\n        rm -r $TOADDPATH/*\r\nfi\r\n```\r\n\r\nI don't know if the `-1` flag([doc](https://manual.calibre-ebook.com/generated/en/calibredb.html#adding-from-directories)) works well for everyone or not.\r\n\r\nI think this would be very useful for a lot of people, and could probably be applied to your [other repo](https://github.com/aptalca/docker-calibre) as well.\r\n\r\n--_Edit: fixed typo to script_"},"comment":{"url":"https://api.github.com/repos/aptalca/docker-rdp-calibre/issues/comments/209727951","html_url":"https://github.com/aptalca/docker-rdp-calibre/issues/11#issuecomment-209727951","issue_url":"https://api.github.com/repos/aptalca/docker-rdp-calibre/issues/11","id":209727951,"user":{"login":"aptalca","id":541623,"avatar_url":"https://avatars.githubusercontent.com/u/541623?v=3","gravatar_id":"","url":"https://api.github.com/users/aptalca","html_url":"https://github.com/aptalca","followers_url":"https://api.github.com/users/aptalca/followers","following_url":"https://api.github.com/users/aptalca/following{/other_user}","gists_url":"https://api.github.com/users/aptalca/gists{/gist_id}","starred_url":"https://api.github.com/users/aptalca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aptalca/subscriptions","organizations_url":"https://api.github.com/users/aptalca/orgs","repos_url":"https://api.github.com/users/aptalca/repos","events_url":"https://api.github.com/users/aptalca/events{/privacy}","received_events_url":"https://api.github.com/users/aptalca/received_events","type":"User","site_admin":false},"created_at":"2016-04-14T02:22:32Z","updated_at":"2016-04-14T02:22:32Z","body":"Thanks for the code, I'll look into the feasibility of adding it in"}}