GithubHelp home page GithubHelp logo

rb-fileorganizer's Introduction

Development Stop

Hi everyone, I took over this plugin many years ago and have since moved on to other methods of maintaining my library. If someone wants to fork it and take over i'm happy to let this go as i don't have the need for this plugin anymore.

RHYTHMBOX FILEORGANIZER

Please help with testing this new release! A lot of big changes have happened that need testing before i can be comfortable with a stable release.


WARNING, ONGOING DEVELOPMENT VERSION.

  • Please be aware that for the moment this repo may have bugs that i haven't noticed in my testing.
  • I have tested all current features and they work as expected (But that isn't a promise it will be stable for you)

Welcome to version 3.91-dev

This update removes a lot of code that doesn't have any real purpose in the current rhythmbox.

I have dropped dbops.py and simplified the database naming using urllib.parse.

We no longer look for cover art as this has changed from older versions of rhythmbox.

Instead of updating tags this feature is removed.

So far in testing the changes are setting correct paths but the files are sometimes becoming 'missing' The files move and update but I think this may be due to my large library (180,000) and that testing has been done over sshfs as well as local files.

1.0 Install 2.0 Usage & Main Features 2.1 Other Features 3.0 Configuration and customisation 3.1 Compilation Support 3.2 Plugin Preferences Window 4.0 Change History 5.0 Contribute 6.0 Links

1.0 INSTALL

To install from the terminal using make: make install

To check the dependencies, then install using python: python3 ./install.py

If you want to install manually, extract to the following directory:

  • $HOME/.local/share/rhythmbox/plugins/fileorganizer/

You can test python dependencies by running: python3 -c "import depends_test; depends_test.check()"

Possible extra requirements are:

  • python-configparser (I have to confirm this but i think it's a default module in python 3.2+)
  • gir1.2-notify-0.7 (Debian name, GObject notify library)
  • dconf-editor (to make changes to the rhythmbox library settings)

2.0 USAGE & MAIN FEATURES

This plugin is pretty simple but it has a few complicated features under the hood.

Once the plugin is installed, simply enable it in Rhythmbox. A restart of rhythmbox will be required to detect the plugin if it was open when you installed.

When the plugin is enabled, you will notice an option in the right-click menu of music items (like songs) that will read 'Organize selection'. Clicking this will organize the selected files following a defined structure (see 3. Configuration and customisation) for both folders and filenames. That's all there is to it.

2.1 OTHER FEATURES

Intelligent duplicate backup:

  • When two songs have the same name, the plugin moves the file to a backup directory.
  • If you lose a file, you'll probably in a folder named 'backup' in the root of your music library.

Move all non music files with your music:

  • When enabled, Fileorganizer will move files like text files and pictures with that music file.
  • This is great for keeping all files organised, not just music.

Log file for all actions:

  • The log file is an invaluable tool to see what happens when running fileorganizer.
  • By default this file is hidden in your home folder: $HOME/.fileorganizer.log

3.0 CONFIGURATION AND CUSTOMISATION

The output when running 'Organize Selection' is set from dconf-editor using default Rhythmbox settings:

  • org.gnome.rhythmbox.library/layout-filename (Is the filename for your output)
  • org.gnome.rhythmbox.library/layout-path (Is the folder path for your output)
  • org.gnome.rhythmbox.rhythmdb/locations (Is your library path)

Using these, your final output becomes:

  • library + layout-path + layout-filename

The Locations setting can actually be multiple locations, the first value is always taken by the plugin.

The Variables for layout_path and layout_filename follow the same values as rhythmbox:

  • %at -- album title
  • %aa -- album artist (Album artist will use track artist if it does not exist)
  • %aA -- album artist (lowercase)
  • %as -- album artist sortname
  • %aS -- album artist sortname (lowercase)
  • %ay -- album release year
  • %an -- album disc number
  • %aN -- album disc number, zero padded
  • %ag -- album genre
  • %aG -- album genre (lowercase)
  • %tn -- track number (i.e 8)
  • %tN -- track number, zero padded (i.e 08)
  • %tt -- track title
  • %ta -- track artist
  • %tA -- track artist (lowercase)

Variables not ported yet:

  • %ts -- track artist sortname
  • %tS -- track artist sortname (lowercase)

3.1 COMPILATION SUPPORT

Fileorganizer will use the album artist tag which is a part of rhythmbox and replace the artist field. For example:

  • Path: /music/$artist/$year $album/$disc-$track - $title
  • Input: /music/new/spawn soundtrack/01 - filter & the crystal method - trip like i do.mp3
  • Set Album Artist to 'Various' in Rhythmbox.
  • Output: /music/Various/1997 Spawn/1-01 - Can't You (Trip Like I Do).mp3

3.2 PLUGIN PREFERENCES WINDOW

The preferences window gives you the ability to switch features on or off.

Preview Mode

  • If enabled, 'Organize Selection' will only check for changes and open a text report after completion.

File/Folder Cleanup

  • If enabled, files within the same folder that aren't music files are moved as well

Remove Empty Folders

  • If the source folder is empty after moving, delete the folder

Log File:

  • Set the filename of the log file (the base path is your home folder)

Strip NTFS Chars

  • Strip out characters that Windows can't handle. (NTFS actually supports more characters than Windows allows)

4.0 CHANGE HISTORY

3.99*-dev-*

  • Removed tag update options and code
  • Removed cover art import, the naming/format has changed
  • Using urllib.parse to encode DB imports

3.-dev-

  • Added python script install.py to check all imports. (Also added uninstall.py)
  • Removed older v2.99 zip file
  • Removed INSTALL & UNINSTALL (these were just calls to make anyway)
  • Ongoing pylint/refactor changes.
  • Update config window to remove depreciated widgets. (requires GTK+ 3.0)
  • Move conf template into base plugin dir

Update 2015/05/05:

3.2013.09.16: Currently running on RB 3.0

  • Tag Library python-eyed3 not available for python 3.

2.0.1-2 features include: Preview Mode

  • Files are not moved or changed in any way while in preview mode.
  • When completed up to two text files will open showing changes or possibly damaged files.
  • To enable preview mode, set enable it in the preferences window. Update Tags After Relocation
  • The plugin now uses python-eyeD3 for checking tag values.
  • After organising the selected files, fileorganizer will update the mp3 tags for you to

2.0 features include:

  • GTK3 Rhythmbox 3/GIT support
  • Moved settings from Gconf to Gsettings
  • Random bug fixes
  • New code base [1]

1.1 features include:

  • UI Implemented
  • Configuration File
  • Import cover art from the source folder to the RB cache if found.
  • Ability to disable file/folder cleanup and other features.

1.0.3-2 features include:

  • Fixes to backup support.
  • UTF-8 encoding support.
  • Fixed move folder contents with files.
  • Notification on completion using pynotify.
  • More code cleanup and additions.

1.0.3 features include:

  • File management of non music files.
  • A physical log file stored in the home folder.
  • Moved the backup folder to the root of the music library.
  • Compilation support using rhythmbox's album artist field.

1.0.2 features include:

  • Support for Rhythmbox > 0.13.1
  • Added $disc and $year support.

5.0 CONTRIBUTE

To contribute, please refer to our github page [2]

6.0 LINKS

[1] http://code.launchpad.net/~lachlan-00/rb-fileorganizer/legacy [2] https://github.com/lachlan-00/rb-fileorganizer

rb-fileorganizer's People

Contributors

alza-bitz avatar carelessproperty avatar chrisgraham avatar fossfreedom avatar lachlan-00 avatar rkoesters avatar sirfz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rb-fileorganizer's Issues

Encoding issue

Hi,

I used to have my music library here: ~/Musique/Bibliothèque ; (Bibliothèque is the french word for Library).

I just realized my whole library is now here: ~/Musique/Biblioth%C3%A8que

I'm almost sure it's because of rb-fileorganizer, as I've ever experienced it this with Rythmbox before.

Anyway, I saw that:

1.0.3-2 features include:
[...]

  • UTF-8 encoding support.

So I guess it means that UTF-8 is supported in the ID3 tags or something like that.

I'd like to know if you could support it for folders names and library path ? And so, avoid this kind of behavior. :)

Thanks !

Could not find loader 'python'

Fresh installation of:
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty

I open rhythmbox from a command line and when I try to enable the plugin it does not appear and the following error is shown to the stderr:

(rhythmbox:5923): libpeas-WARNING **: Could not find loader 'python' for plugin 'fileorganizer'

Python3-eyed3 is now available

I installed the plugin using the deb. It did not like that the dependency python-eyed3 did not exist. I change the dependency from python-eyed3 to python-eyed3 | python3-eyed3 (to make the dependency from one of both, and it worked with no fault) on the control file. I do not know how to modify that file, if I do I will provide a patch.

Code cleanup and refactor

@fossfreedom do you have any feature you'd like implemented in the plugin?

I'm going to refactor the code and remove the tagging cause it was hacky and eyed3 still doesnt support python3 properly.

just do movement/db management and do it well.

I'll try and comment it better and make it easier for other people to read it.

"Cleanup" has various issues

"Remove Empty Folders" will not work if "File/Folder Cleanup" is not enabled, and the preferences UI does not make this clear.

And then there's the moving of non-music files, which HAS to happen if "File/Folder Cleanup" is on.

I think it makes more sense to have a "Remove Empty Folders" option and a "Move Associated Files" option, as really the two things you do under "File/Folder Cleanup" are pretty different things and I see no reason to have a parent option to them.

And all this said, the moving of non-music files is very dangerous, because the user may be reorganizing stuff that is not under a deep directory yet. E.g. ~/Music/example.mp3. Any other files in ~/Music, e.g. random playlist files, will get moved with it.

Undocumented dependency

Hi,

I just got this when loading FileOrganizer:

ERROR:root:Could not find any typelib for Notify
Traceback (most recent call last):
  File "/home/progval/.local/share/rhythmbox/plugins/fileorganizer-gtk3/fileorganizer.py", line 17, in <module>
    from gi.repository import GObject, Peas, PeasGtk, Gtk, Notify

Installing gir1.2-notify-0.7 fixed it, but it should be mentionned somewhere.

import warnings

need to look at what are the actual version requirements of the GI libraries

depends_test.py:23: PyGIWarning: Peas was imported without specifying a version first. Use gi.require_version('Peas', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GObject, Peas, PeasGtk, Gtk, Notify, Gio

depends_test.py:23: PyGIWarning: PeasGtk was imported without specifying a version first. Use gi.require_version('PeasGtk', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GObject, Peas, PeasGtk, Gtk, Notify, Gio

depends_test.py:23: PyGIWarning: Notify was imported without specifying a version first. Use gi.require_version('Notify', '0.7') before import to ensure that the right version gets loaded.
from gi.repository import GObject, Peas, PeasGtk, Gtk, Notify, Gio

depends_test.py:25: PyGIWarning: RB was imported without specifying a version first. Use gi.require_version('RB', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import RB

Encoding issue

Hi,

The problem described in #16 is back.

My library folder is ~/Musique/Bibliothèques/Musique. When I click on Organize selection, it'll create new folders in ~/Musique/Biblioth%C3%A8ques/Musique. But, unlike in #16, the songs are not moved to this new folder, they are unchanged in ~/Musique/Bibliothèques/Musique.

menu item disappears

The "Organize Selection" option disappears from the right-click menu every time I restart Rythmbox. In order to bring it back, I have to disable the plugin, restart Rythmbox, and then re-enable the plugin.

Support for apt install on Ubuntu 22.04

Looks like there is no published package for the file organizer plugin on the foxxfreedom ppa. I have literally no idea what the solution is.

In mean time I will try to install it from source 👍

problem moving files with special characters in file and directories

I had problem organizing with special characters in file and directories.
Its more a problem in shutil (python 3.8) but I made it work by modifying fileops.py.
Adding:
if not os.path.isdir(os.path.dirname(destin)): os.makedirs(os.path.dirname(destin))
before
shutil.move(source, destin)

For example
IN: /N/iTunesClassés/Music/Compilations/Hits 60's & 70's/07 I'm Not In Love (Acoustic).mp3
OUT: /N/iTunesClassés/Music/10cc/Hits 60's & 70's/I'm Not In Love (Acoustic).mp3

move from eyeD3 to mutagen

mutagen seems to have support for python 3 without any additional changes/packages.

i'll have to change eyed3 to mutagen.

Hidden Folders

Some albums start with a ".", this causes the folder to be hidden when the organizer is used. I'm guessing that this also applied to other information (ie artist, song name, etc.)

I was using the version where adcebf4 is the last commit.

Information from fileorganizer.log:

Britney Spears - ...Baby One More Time - 08:59:07 AM
    IN:    /home/carelessproperty/Music/Music_on_Windows/Britney Spears/_..Baby One More Time/11 The Beat Goes On.mp3
    OUT:   /home/carelessproperty/Music/Music_on_Windows/Britney Spears/...Baby One More Time/Britney Spears (...Baby One More Time) - 11 - The Beat Goes On.mp3
 ** INFO:  Updating Database:
    OUT:   file:///home/carelessproperty/Music/Music_on_Windows/Britney%20Spears/...Baby%20One%20More%20Time/Britney%20Spears%20(...Baby%20One%20More%20Time)%20-%2011%20-%20The%20Beat%20Goes%20On.mp3
 ** INFO:  Removing empty directory
    /home/carelessproperty/Music/Music_on_Windows/Britney Spears/_..Baby One More Time

Settings:
fileorganizersettings

make install doesn't work

Hi,

I don't remember how I installed rb-fileorganizer the first time. But I try to install it from the git repo today, and, when I use:

python3 ./install.py

It works.

But, if I try to do it with:

make install

I've got this error:

[...]
cp template/*.conf "/home/leo/.local/share/rhythmbox/plugins/fileorganizer/"template -f
cp: impossible d'évaluer 'template/*.conf': Aucun fichier ou dossier de ce type
Makefile:7 : la recette pour la cible « install-req » a échouée

Line 3 means: no file or folder with this name.
Line 4 means: the recipe for the target "install-req" failed

So, I guess this folder and file(s?) used to be here in previous releases and the Makefile wasn't updated.

But, as it's the first way explained in the README.md, you should maybe remove it (as installing with install.py is fine) or fix it ?

[enhancement] Auto move/copy to library folder

Hi,

First, thanks for this extension, it's very useful to me.

I would like to ask you if you could add a feature, I used it back in the days with iTunes and it's the only thing missing to Rhythmbox IMO.

Let's say I have an audio file somewhere not in my library. I right-click on it and open it with Rhythmbox, then, it's automatically copied / moved (I don't know what's best, maybe an option to let the user choose) to my library in the right place using ID3 tags.

What do you think about it ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.