![]() |
#1 |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Auto-add weirdness
I have an auto-add directory set up for Calibre, and sometimes when I drop files in it they get added, and sometimes not. Previously Kovid has said that this is likely due to files being locked by e.g. anti-virus scanners. However, I just dropped two files in there; one got added, and one didn't. When I opened the directory to look, I found 4 files there, some of which had been there for nearly two weeks. Now, during those two weeks I have rebooted the machine at least three times (Windows update, anti-virus update, and once when Windows went on strike)and restarted Calibre even more often. A quick look with Process Explorer didn't show any processes with handles open for those files.
Can anyone tell me what might be going on here? Why would Calibre be ignoring some files but not others, even across multiple reboots? |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,919
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Not a file type that Calibre recognizes as a auto-add book? (default Auto-add setting) Preferences:Auto-add (tab)
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,224
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Check the permissions on the files. They need to have both read and write permission.
|
![]() |
![]() |
![]() |
#5 | |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
Many thanks, as usual! Last edited by Phssthpok; 01-01-2016 at 05:09 AM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
I did some more experimentation... I couldn't find an unzipper that will let me ignore the stored attributes of the files, so I wrote a batch file to reset the attributes. My idea was to set this up to run at regular intervals to prevent things getting stuck for weeks. However, it had no effect. I changed it to touch the file after resetting the attributes -- still no effect. When I add another file to the auto-add directory, both files disappear after a few seconds.
So here's a plea for a new feature: a preferences option to say "I want Calibre to ignore (reset) attributes on book files in the auto-add directory". I only use the auto-add directory for auto-adding (which is unsurprising) and so if I drop books there it means I want them to be added, with no ifs or buts. How about it? Last edited by Phssthpok; 01-01-2016 at 05:09 AM. |
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,224
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I'm afraid not. There is no way to make "resetting file attributes" robust across OSes and filesystems. It's up to you to make sure file attributes for files you put there are correct.
Simply have your batch file create and delete a temporary file in the auto-add folder, that should be enough to trigger a rescan. Or do a file rename to a new filename, though whether that is sufficient or not will depend on the file watching semantics of Qt on your platform. Last edited by kovidgoyal; 01-01-2016 at 05:31 AM. |
![]() |
![]() |
![]() |
#8 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,645
Karma: 29710510
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@Phssthpok - You're using Windows right
Extract the files to FolderX, run a batch file or a script against FolderX contents that forces RO off (attrib command) and moves the files from FolderX to the Autoadd folder (move command) . Maybe you could do the extract, attrib and move in one fell swoop with something like a powershell, ahk, or a ptfb script. I'm not aware of any Windows unarchivers that provide an option to set/unset attributes - apart from the Archive attribute. Although I have a memory cell suggesting that Total Commander might have something - but that would be tantamount to using a jackhammer to crack a peanut. BR |
![]() |
![]() |
![]() |
#9 | ||
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
![]() Quote:
Code:
@echo off cd "\path\to\Calibre\autoadd" if not exist *.* exit/b attrib -r -h -s *.* echo >foo.xxx del foo.xxx I'd still prefer a Preferences option though! ![]() Last edited by Phssthpok; 01-01-2016 at 06:52 AM. |
||
![]() |
![]() |
![]() |
#10 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,224
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
os.chmod will only work if you have permission to alter the file's attributes, which on unix depends on the file's owner/group compared to yours and on windows on the phase of the moon. And I wont even start down the rabbit hole of filesystem specific attributes, read the man page for chattr if you like.
|
![]() |
![]() |
![]() |
#11 | |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
If using os.chmod() to grant RW permissions failed for a particular setup, no-one would be any worse off, but in many/most cases where: a) I have RW access to the auto-add directory so I can add files and see if they are still there later, b) I'm running Calibre from an account which has RW access to the auto-add directory so Calibre can import the files and delete them, c) I put files in the auto-add directory because I want the files to be imported by Calibre if at all possible, and d) only the common read/write attributes need setting for this to happen; ... it should work, and then I would be much better off... wouldn't I? Last edited by Phssthpok; 01-01-2016 at 08:06 AM. |
|
![]() |
![]() |
![]() |
#12 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,224
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No that is an example of magic behavior. It makes things hard to predict. Sure you individually would be better off. But the feature as a whole becomes less predictable. Right now it is simple, incorrect permissions => no auto add.
With your proposal incorrect permissions => may or may not auto-add depending on the phase of the moon. |
![]() |
![]() |
![]() |
#13 | |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
OK, maybe these things aren't Calibre's fault. Still, I think that this would if anything make it less magical by removing one of the potential problems for a lot of users (certainly all Unixers, most if not all Windows users). It certainly wouldn't make it behave less well than it does now. But hey, you're the boss, and I suspect we'll have to agree to differ if this doesn't convince you... ![]() Last edited by Phssthpok; 01-01-2016 at 11:22 AM. |
|
![]() |
![]() |
![]() |
#14 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,919
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Some things, a user just needs to do. Calibre deals with normal files |
|
![]() |
![]() |
![]() |
#15 | |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
And copying a file from a CD to your auto-add directory produces a file without write permission (= "with read-only set" on Windows), which os.chmod() would (should?) fix... so I don't get your point, since my proposal would make it easier to use auto-add to import files from a CD...? |
|
![]() |
![]() |
![]() |
Tags |
auto add |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre Auto Add | james14 | Library Management | 10 | 05-31-2014 02:49 AM |
How-to Auto-add cover.jpg? | buralex | Library Management | 6 | 03-05-2013 03:25 AM |
Is this possible: Auto-add book/magazine then auto e-mail to device? | runningwithbulls | Library Management | 5 | 09-10-2012 12:27 PM |
Help with new feature: Auto-Add Folder | kbullkar | Library Management | 12 | 03-30-2012 06:15 AM |
need auto add help | bulldogmo | Calibre | 10 | 02-15-2012 10:38 PM |