forked from calibre2opds/calibre2opds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DevNote - Catalog file naming conventions.txt
110 lines (83 loc) · 5.32 KB
/
DevNote - Catalog file naming conventions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
DevNote - Catalog file naming conventions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This note specifies the naming standard for generating files within the catalog and sub-catalogs
RULES:
1. All filename sshould be unique
2. Files are organised into directories where the directory DisplayName corresponds to the start of the
filename. This is primarily for performance by avoiding having very large number of files in
the same folder. It is also convenient if you ever peruse the catalog at the file elvel.
3. Direcories will never be more than one level deep.
4. The top level folder will only contain generic files
3. When generating sublevels a Prefix is added to the folder and file names.
This prefix should be consistent for all files/folders at the same catalog level
Details:
~~~~~~~
author/ Folder for Files for each author
author_nn Files for a given author listing series/books
(we suppress pagination within an author although this could be changed)
author_nn_ss_Page_nn Files listing book for a given series for that author
author_nn_allbooks_Page_nn Files listing all books for the given author
book/ folder for details about individual books
book_nn File for a book with id nn
series/ Folder for files for each series
At the moment this is always a top level entry - not subidivided by level
series_nn_Page_nn
tag/ Folder for files for each tag
There is one of these for each level so that tag books are level dependent
tag_nn_Page_nn Files giving books for a specific tag
Sub-catalogs:
~~~~~~~~~~~~
allbooks/ Folder for allbooks sub-catalog split by letter/page
allbooks_XX_Page_nn Files for allbooks split-by-level
Entries point to books in the book/ folder
authorlist/ Folder for authors sub-catalog split by letter/page
authorlist_XX_Page_nn Files for the author-by-level where XX indicates the split level
Point to author_nn_Page_1 entries in the author/ folder
serieslist/ Folder for series sub-catalog split by letter/page
serieslist_XX_Page_nn
taglist/ Folder for tags sub-catalog split by letter/page (when SplitTagsOn disabled)
taglist_XX_Page_nn Files for tags split by letter
tagtree/ Folder for tag order by tree (when SplitTagsOn enabled)
tagtree_XXXXXX_Page_nn Fiels for tags organised by catgorie. XXXXXX is unique per category
rated/ Folder for rated books sub-catalog.
rated_XXXX_Page_nn Files for the list of books at given rating levels (XXX is rating)
recent/ Folder for recent books sub-catalog.
recent_XXXX_Page_nn Files for list of books in each period (XXX is period)
featured/ Folder for featured books sub-catalog split by page
featured_Page_nn Files for list of books in the featured list
XXXXXXX/ Custom catalog sub-folder
XXXXXX_YY_Page_nn
Custom Catalogs that generate additional levels via a search will have a Prefix
generated and added to the start of all folder names. As we need the prefix
to be consistent across runs, the prefix is generated using CRC32 on the breadcrumbs.
e.g.
ABCDEFGH_allbooks/
ABCDEFGH_allbooks_XX_Page_nn
etc.
Tags that generate additional levels are treated as a special case of custom folders
NOTE:
It has been found that if you are using a FAT32 filing system for either the temporary
files or the final catalog, then there is a limit to the number of files that can be held
within a folder. This is limited by the maximum of 64K directory entries, which by
the time you take into account multiple entries per file to support long file names
equates to something like 16K files per folder. To allow for this, the 'books',
'author' and 'serie' folders are limited to 100 entities per folder and the 'tag'
folder to 100 tags per folder. It may be necessary to consider in the future if
these values need to be more dynamic according to the number of split levels allowed
as higher split levels can result in more files per folder.
Security
~~~~~~~~
Calibre2opds offers an option to 'encrypt' filenames. Strictly speaking this obfuscates the
names so that the are virtually impossible to guess rather than really encrypting them. The
purpose of this feature if for thos who want to put their libraries on the internet and are
not able to provide other protection such as username/password (e.h. DropBox users). Making
names almist impossible to guess means that such catalogs are not really prone to being found
by unauthorised users.
An open question is whether we should also provide this type of obfustication to Book files.
However they are already deemed to be hard to guess as they are heavily dependant on both
their author/title information and also the calibre Id that is included in the names.
If file encryption is active, then a (8 hex character) value is added to the start of the
folder (and the index file). This should keep all related folders and files together while still
keeping sufficient obfustication to avoid it being easy to guess the correct path to any particular file
File names within folders also have a value added to the start of the DisplayName. This value is
different for each file group although it will be the same for related files.