Dewey: the guide

Dewey keeps an index of your big folders (movies, series, books, music, photos, code, documents). With the index you can find anything in a second, sort what lands in your New / ToSort folders, find duplicates, spot missing episodes and read a report about your library.

Three promises: Dewey never deletes anything, it never moves a file until you tick it and press a Move button, and every move can be undone.

All the screenshots below use a small demo library: a few movies, a series with gaps, books, music, photos, a code project and some documents.

1. Your first ten minutes

The Library tab with the demo folders added
  1. Open the Library tab and press Add folder…. Pick a folder that holds one kind of thing (for example Movies, Books, Music). Add one folder at a time; you can add as many as you like. A removable disk gets a label (for example Backup-4TB) so you can tell it apart later.
  2. Press Scan now. The first scan takes a while on a big disk. Later scans only look at what changed, so they are quick.
  3. Tick index text inside files if you want to search inside documents, books and subtitles. Tick PDF too if you also want the text of PDFs (needs the poppler-utils package).
  4. Go to the Find tab, type a few words and press Search (or Enter).

Your folders can be as messy or as tidy as they are. Dewey learns from the way you already keep things: the more consistent a folder is, the better its suggestions will be.

2. Finding things

Searching for sci-fi movies

Type words in the search box. Words match file names and the names of the folders above them, so asimov foundation finds Books/Asimov, Isaac/Foundation.epub even though the file name does not say Asimov.

You can add filters in the same box:

Write It means Example
kind:movie only that kind (book, movie, music, source, text, image, archive, dir) kind:music queen opera
ext:mkv only that file extension ext:epub dune
in:scifi only inside folders whose name contains that word kind:movie in:scifi alien
"war and peace" an exact phrase ext:epub "war and peace"

The kind box next to the search button adds the kind: filter for you.

Searching inside documents

Search inside documents also looks at the text in your files. In the picture it finds a lease by the words notice period and shows the matching sentence in the Note column. This works for files scanned with index text inside files switched on.

Find related: select a result and press it. Dewey lists the companions of that file: other versions, files of the same series, the same author, with a percentage. Double-click a result to open its folder.

Techniques that work well:

3. Sorting the inbox

Most libraries have a folder where new things arrive. Dewey treats a folder named New, ToAdd, ToSort, inbox, unsorted or incoming (inside any of your library folders) as an inbox. You can change these names at the bottom of the Library tab (Inbox folder names, then Save).

Suggestions for the inbox folders

Press Find suggestions. For every item in an inbox, Dewey shows:

How to read the picture:

Only the confident ones (55% or better) are ticked for you. Look at the list, tick or untick any row yourself, then:

Techniques

4. Duplicates

Finding duplicates

Press Find duplicates. Dewey groups files with exactly the same content. In each group one row says KEEP (a copy outside the inbox, the oldest, the one with the shortest path) and the others are copy.

5. Reports and missing episodes

A library report

Library report shows the totals, the space by kind, the biggest files and folders, the oldest files, empty folders, what is waiting in the inbox folders and which drives are unplugged. Tick include duplicates waste (slower) to add how much space exact duplicates take.

Series with gaps

Find missing episodes looks at your series folders and tells you what is missing. In the picture, foundation S01: missing 4, 7-8 (have 1-9) means season 1 has episodes 1 to 9 but 4, 7 and 8 are not there.

6. Rules: when you know better than the guess

Open Library > Edit rules. Dewey opens rules.ini in your editor (a template with comments is created the first time). Rules run before the learned guesses, and the first rule that matches wins. Rules are loaded the next time Dewey starts.

[rule:Queen singles]
match=*Under Pressure*
dest=Queen/Singles

[rule:Leave Miles alone for now]
match=Miles Davis*
dest=@skip

A rule has a name in the brackets, conditions and a destination:

Condition Meaning
kind=music the kind of the item
match=*.srt;*.ass file-name patterns (* = anything), separated by ;
meta=jazz a tag (genre, artist, author…) contains this text
inbox=ToSort only items found in an inbox with this name
Destination Meaning
dest=/data/Music/Jazz a folder (a path starting with /)
dest=Queen/Singles a folder relative to the folder that holds the inbox (here Music/ToSort is the inbox, so this is Music/Queen/Singles)
dest=@companion next to the file with the same name that is already in the library (for subtitles)
dest=@skip leave it where it is
{artist} {album} {title} {year} {author} {series} {kind} {name} {ext} filled from the file’s tags and name, for example dest=/data/Music/{artist}/{album}

Test every new rule with Find suggestions: the Why column says rule: Queen singles, or rule: leave here.

7. Recipes for every kind of folder

Movies

TV series

Books and e-books

Music

Photos and images

Source code and projects

Documents, contracts, notes and PDFs

Downloads and mixed folders

Removable and backup drives

Archives and installers

8. A routine that keeps a library tidy

  1. Scan now (or after you copy things in).
  2. Sort inbox: Find suggestions, move the confident ones, look at the rest.
  3. Duplicates: move the extra copies to a review folder; empty that folder when you are sure.
  4. Reports > Find missing episodes after adding series.
  5. Once in a while, Library report for the big picture: where the space goes.

9. For the command line

The same things are available as the dewey command:

dewey add ~/Books                      # add a library folder
dewey add /media/usb --label Backup-4TB
dewey scan --content                   # add --pdf for PDFs
dewey find kind:movie in:scifi         # words, kind: ext: in: "phrase"
dewey find "notice period" --content   # words inside documents
dewey where foundation                 # which folders hold the matches
dewey related "Alien (1979)"           # companions and other versions
dewey sort --dry                       # suggestions only
dewey sort                             # ask for each item
dewey dupes --min 100000               # exact duplicates
dewey gaps                             # missing episodes
dewey report --dupes                   # the library report
dewey undo                             # put the last batch back
dewey help                             # this guide (es, he: dewey help es)

10. If something looks wrong

Problem Try
Nothing found Check the folder is in the Library list and press Scan now.
A new file is not suggested Is it inside a folder with an inbox name? Press Scan now first. Files that are still being written are skipped.
Everything says 30% The library folders do not give Dewey enough to learn from yet. Keep new things consistent, or write a rule.
A disk says OFFLINE Plug it in, or use Drive moved… if it has a new path.
The search does not find text inside files Scan again with index text inside files ticked.
The window does not start Install libgtk2.0-0, and use the dewey command meanwhile.

Your settings and the index are in ~/.config/dewey/. If the index ever goes wrong, delete index.db there and scan again; no file of yours is touched.