Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Devices

Notices

Reply
 
Thread Tools Search this Thread
Old 09-25-2011, 07:37 PM   #1
fekhner
Addict
fekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animals
 
Posts: 326
Karma: 6720
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 ?
fekhner is offline   Reply With Quote
Old 09-26-2011, 12:51 AM   #2
Dopedangel
Wizard
Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.
 
Dopedangel's Avatar
 
Posts: 1,098
Karma: 8671315
Join Date: Dec 2006
Location: Singapore
Device: Coolreader(Nexus 5)\Coolreader(Nook Touch)
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.
Dopedangel is offline   Reply With Quote
 
Enthusiast
Old 09-26-2011, 03:21 AM   #3
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,433
Karma: 831552
Join Date: Jan 2010
Location: France
Device: Many android devices
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', ''))'}
You can simplify the above if you don't care about submatches, meaning you don't have tags of the form "my_news" or don't care if you get both "news" and "my_news" when checking for the tag "news".
chaley is offline   Reply With Quote
Old 09-26-2011, 05:57 AM   #4
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80446
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.
Manichean is offline   Reply With Quote
Old 09-26-2011, 06:41 AM   #5
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,433
Karma: 831552
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by Manichean View Post
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.
Hadn't noticed that, even though I have looked at that code a thousand times.

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.
chaley is offline   Reply With Quote
Old 09-26-2011, 07:28 AM   #6
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80446
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Quote:
Originally Posted by chaley View Post
Hadn't noticed that, even though I have looked at that code a thousand times.
I found out about that as an undocumented feature sometime around 0.6, if memory serves. It was never documented, as far as I know, and is now made largely redundant by templates. I use it because of inertia- I never quite got around to configuring a template, and, taking care to have only one tag starting with a slash per book, it works for me.

Quote:
In all the above cases, all but the last component (after the last slash) of the path template are ignored.
Interesting to know, thanks for looking.
Manichean is offline   Reply With Quote
Old 09-26-2011, 11:07 AM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,924
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
IIRC user_none added that feature in the very early days of calibre.
kovidgoyal is online now   Reply With Quote
Old 09-27-2011, 02:16 PM   #8
Prevayl
Junior Member
Prevayl began at the beginning.
 
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
Prevayl is offline   Reply With Quote
Old 10-06-2011, 08:39 AM   #9
fekhner
Addict
fekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animals
 
Posts: 326
Karma: 6720
Join Date: Sep 2010
Device: DRs, EE, ipad/iphone, Helix
Quote:
Originally Posted by chaley View Post

Starting a "more than you wanted to know" section....
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 ?
fekhner is offline   Reply With Quote
Old 10-06-2011, 11:20 AM   #10
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,433
Karma: 831552
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by fekhner View Post
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 ?
No.
Quote:
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.
The file path normalizer strips relative moves.

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.
chaley is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 11:03 PM.


MobileRead.com is a privately owned, operated and funded community.