pysorter icon indicating copy to clipboard operation
pysorter copied to clipboard

Add more common filetypes

Open chriscz opened this issue 9 years ago • 5 comments

The current filetypes.txt contains some really archaic types. Consider updating it to contain more filetype definitions.

chriscz avatar Sep 30 '16 21:09 chriscz

I'm interested. Is there any kind of convention in naming destination directories?

KayvanMazaheri avatar Oct 08 '16 11:10 KayvanMazaheri

Hi Kayvan. The only preference I have right now is: lowercase, and use underscores instead of spaces.

chriscz avatar Oct 08 '16 17:10 chriscz

I'm considering contributing a PR that will hook up the mimetypes module to your rules. Would you be interested in such functionality, or would you prefer more manually-curated file types?

sseemayer avatar Oct 13 '16 19:10 sseemayer

Hi Stefan,

Thanks for your interest in the project!

Hooking up the mimetypes module will be better than the current default behaviour, which is to move unrecognised files to the other/ directory.

Ideally I would like to group various mimetypes under a common banner, for example zip, tar.gz etc, under archives. But for now just adding mimetypes as the default behaviour would be great.

You can look in the filetypes.py file, near the end of the RULES dictionary, there are two default entries -- one for files and one for directories. Yours should be inserted right before the current default file behaviour.

chriscz avatar Oct 13 '16 19:10 chriscz

Thanks for the quick reply! I hope the PR is to your liking, of course feel free to discard / edit any of my changes to make it fit into your project's vision better.

sseemayer avatar Oct 13 '16 20:10 sseemayer