Giter Site home page Giter Site logo

dragonq / music-directory-syncer Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 4.05 MB

Sync an entire directory of music to another based on codec and tag rules.

Visual Basic .NET 100.00%
music sync sync-directories music-folder-syncer codecs tags foobar2000 music-directory-syncer

music-directory-syncer's Introduction

Music Directory Syncer

Music Directory Syncer is a Windows application that allows a directory of music files to be synced to any number of others, according to certain rulesets:

  • Tags being present
  • Tags having certain values
  • File type

Audio files can be converted to a chosen lossy format using ffmpeg if desired to save space, e.g. on a mobile device. This can be done to all files or just losslessly compressed ones. You can also choose to apply ReplayGain volume adjustment if the device you're using doesn't support ReplayGain tags. Once you've made your synced directory, you can use any directory syncing application to copy it to a mobile device, for example.

Create New Sync

Music Directory Syncer will run quietly in the background watching your chosen source directory for changes, and it will update all of your sync directories on-the-fly.

music-directory-syncer's People

Contributors

dragonq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

music-directory-syncer's Issues

Renamed temporary files cause issues

Consider the following edge case:

  • SrcFileA has been renamed to SrcFileB.
  • SrcFileB matches configured tags so should be synced.
  • SyncFileA doesn't exist.

The current behaviour is to attempt to transcode SrcFileB to SyncFileB. This works fine, unless the following is also true:

  • SyncFileB already exists.

In this case, the application hangs (if transcoding) or fails to transcode (if copying).

This can happen if the "rename" event is actually an "overwrite" event. Since there's no distinction in the FileSystemWatcher between these two types of events, we need to deal with it ourselves. This has been seen to happen when Foobar changes a file's tags: it creates a new temporary file (SrcFileA in this case) and then renames that temporary file to the original file's name (SrcFileB), overwriting it.

The fix is to delete SyncFileB before attempting to copy/transcode SrcFileB, if it exists.

Directory.CreateDirectory() sometimes fails because directory already exists

Despite Microsoft's documentation stating that Directory.CreateDirectory() is thread-safe and will not throw if the directory specified already exists, it does seem to occasionally.

This has been seen to happen in FileParser.TranscodeFile(). Example error message:

05/06/2020 17:56:57 [Warning] : [07148] ...transcode failed [1]. Exception: Cannot create "\\fractal\Scratch\SyncThing\Audio\Best Music\The White Stripes\De Stijl" because a file or directory with the same name already exists.
05/06/2020 17:56:57 [Warning] : [07148] Sync file processing failed: "\The White Stripes\De Stijl\The White Stripes - You're Pretty Good Looking (For a Girl).wma". Exception: Transcode failed [1]. Exception: Cannot create "\\fractal\Scratch\SyncThing\Audio\Best Music\The White Stripes\De Stijl" because a file or directory with the same name already exists.
05/06/2020 17:56:57 [Warning] : [07148] File could not be processed. Error: Transcode failed [1]. Exception: Cannot create "\\fractal\Scratch\SyncThing\Audio\Best Music\The White Stripes\De Stijl" because a file or directory with the same name already exists.

This has also been seen to happen in FileParser.TransferToSyncDirectory(). Example error message:

05/06/2020 17:57:04 [Warning] : [07240] Sync file processing failed: "\The White Stripes\Walking With a Ghost\The White Stripes - The Denial Twist (Live).wma". Exception: Cannot create "\\fractal\Scratch\SyncThing\Audio\Home Music\The White Stripes\Walking With a Ghost" because a file or directory with the same name already exists.

This could be resolved with an If Not Directory.Exists() ..., even though that isn't meant to be necessary. If it's a more serious threading problem, more investigation will be required.

Sync folders created by the application have incorrect permissions

If the user chooses a sync directory that doesn't exist, it will be created. However, it appears to be created with strange permissions: the owner is the current user, and the only permission entry is "full control" for "authenticated users". This means the user might not actually be able to access synced files inside the directory.

OGG files are not synced

OGG Vorbis and Opus files are not synced because the tag parser fails for all OGG files. This bug was introduced in v1.0.1.

File IDs in log file can be incorrect with heavy file system changes

When there is a lot of file system changes picked up by the file system watcher, file IDs can become incorrect in the log file. This is caused by an oversight in the locking mechanism for assigning file IDs.

This doesn't affect the application's mission but makes debugging more difficult.

File IDs should start at 1 rather than 0 to avoid confusion

Right now each file has an ID, which is printed to the log file where appropriate. When the application first starts, this ID is 0. This causes confusion since some non-file-specific logging also uses this ID. Changing the starting file ID to 1 will solve this.

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.