09-25-2011, 07:37 PM | #1 |
Addict
Posts: 326
Karma: 6908
Join Date: Sep 2010
Device: DRs, EE, ipad/iphone, Helix
|
user defined device: send items to specific folder
A great feature for the user defined device would be the possibility to send items with certains tags to certain folders, for instance items with the tag "News" to the folder "News" on the device etc. Would this be possible to implement ?
|
09-26-2011, 12:51 AM | #2 |
Wizard
Posts: 1,759
Karma: 30063305
Join Date: Dec 2006
Location: Singapore
Device: Boyue
|
As long as all these folders are in the same directory it is possible. Just use {tags} at the start of your template.
If they are in different folders is still possible but a bit complicated. |
09-26-2011, 03:21 AM | #3 |
Grand Sorcerer
Posts: 11,731
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Using {tags} in a template will get *all* the tags, not test for existence of a particular tag.
Starting a "more than you wanted to know" section.... The easiest thing to do is to create a custom text column (not tags-like) and enter the folder name in that. Then use {#column_name} in the template. You can avoid the extra column by using a template program to check if a tag is there and return the folder name you wish to use. This is rather complicated. The construct would be something like Code:
{tags:'first_non_empty( in_list($, ',', '^news$', 'news_folder', ''), in_list($, ',', '^foo$', 'foo_folder', ''), in_list($, ',', '^bar$', 'bar_folder', ''))'} |
09-26-2011, 05:57 AM | #4 |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
There's a probably-largely-forgotten feature that allows you to specify folders via tags. The first tag starting with a slash will be used as a folder name, for example, an item with the tag '/News' will be sent to the subfolder 'News'. I don't know if this feature or the standard send to device- template takes precedence.
|
09-26-2011, 06:41 AM | #5 | |
Grand Sorcerer
Posts: 11,731
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
This technique works only for send-to-device. Some details gathered by code examination: - If the book has the tag "News", then except for the Nook color, the book will be placed into a News folder. I have no idea why the Nook Color turns this feature off. - If the book has a tag that begins with a '/', then that tag will be used as the folder name. Note that the tag can have embedded slashes, which creates a path. - If a book has both a "News" tag and a tag beginning with a slash, then one of them will win. Which one depends on the order the tags were added to the library. - If a book has more than one tag beginning with a slash, then one of them will win. Which one depends on the order the tags were added to the library. In all the above cases, all but the last component (after the last slash) of the path template are ignored. Last edited by chaley; 09-26-2011 at 07:31 AM. |
|
09-26-2011, 07:28 AM | #6 | ||
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
Quote:
Quote:
|
||
09-26-2011, 11:07 AM | #7 |
creator of calibre
Posts: 43,835
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
IIRC user_none added that feature in the very early days of calibre.
|
09-27-2011, 02:16 PM | #8 |
Junior Member
Posts: 2
Karma: 10
Join Date: Sep 2011
Device: Nook app on a Motorola Photon 4G Android
|
I am super noob to tag and codes like the one posted by Chaley. I have a motorola Photon 4G running Android 2.3.4 and im using the Nook app from B&N i just want to tell the Calibre software to send the books to the device...but to the folders that are already created by the nook app /sdcard/nook/My Documents/
Is there a can someone help me with the code that i would use for that. Im kinda lost. Any help would be greatly appreciated |
10-06-2011, 08:39 AM | #9 |
Addict
Posts: 326
Karma: 6908
Join Date: Sep 2010
Device: DRs, EE, ipad/iphone, Helix
|
Not sure why you are saying that, it is precisely what I wanted to know, thanks very much I am now able for the first time to directly send books to the /Books folder and news to the /News folder in the main directory of the Irex DR1000. [FYI, the default driver puts the books in a new directory called /ebooks that is not accessed by various tools of the device (recently read etc), while the news have been put in the subfolder /ebooks/news and are drowned among all the books].
This brings me to another question, if I may. The default driver for my second device (Irex DR800) puts the books in the correct directory, but the news are still in a subfolder of this directory. What are my options to solve this as well? 1) Can I define a second "user defined device" co-existing with the first ? 2) I tried your code above for the default Irex DR00 driver by indicating a relative path for the news directory, I naively tried "in_list($, ',', '^news$', '../News', '') but it does not seem to work. Any suggestions ? |
10-06-2011, 11:20 AM | #10 | ||
Grand Sorcerer
Posts: 11,731
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
I can't see any way to make the standard driver not put news in a subdirectory. You could run from source and modify the plugin, adding NEWS_IN_FOLDER = False to the Irex 800 driver. Perhaps someone else will have a solution. |
||
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Old Thread] User Defined Column | Cpl Punishment | Calibre | 17 | 02-16-2014 01:43 AM |
Send to device in special folder structure | Arco Witter | Calibre | 18 | 12-16-2011 08:31 AM |
Send to device, sorted by format folder | turb0sun | Calibre | 3 | 06-07-2011 05:44 PM |
Change Send to Device Folder?? | bucketheadmn | Devices | 9 | 03-27-2011 04:22 PM |
Send to device folder structure? | Slite | Calibre | 2 | 01-09-2010 05:20 AM |