Mach5 / supersonic

Open-source web-based media streamer and jukebox fork of Subsonic. Supports MP3, OGG, AAC and other streamable audio and video formats. Runs on Windows, GNU/Linux and Mac using Java.
241 stars 60 forks source link

Modified prefix stripping #24

Closed trapexit closed 12 years ago

trapexit commented 12 years ago

Currently you can create a list of prefixes to strip for sorting reasons. A Perfect Circle ends up under P. However, the code splits the value by space first so if you have replaced spaces with underscores the behavior fails. Ideally you'd be able to indicate prefixes such as "A_" and it just strip it when building the list.

timoreimann commented 12 years ago

To take it even further, I think users shouldn't be required to specify the word delimiter. There's only so many different space "replacements" people are using (e.g., underscore, dash, and multiplications thereof) which should enable Supersonic to auto-detect and handle them properly.

Just my 2 cents.

trapexit commented 12 years ago

So long as it's not "too smart." I'd prefer to have sensible defaults and allow for change than hide the automatic details in the code. For example another bug which I need to post and maybe I'll address this week is that the tag loading code automatically strips from the title the tracknumber if found. That's a hack and screws up most notably NIN's Ghosts I-IV.

timoreimann commented 12 years ago

Overall, I agree with you. However, detecting those underscores and dashes automatically counts as sensible default in my humble opinion. It's something that occurs in a fair number of music collections, so having a generic solution to the problem will be beneficial for many users. Of course, if auto-detection turns out to be too hard to get right (which I don't see at the moment) a manual approach is clearly preferred.

In order to find the best solution from a use case-driven approach: Apart from underscores and dashes, can you think of other space replacements that could possibly complicate things?

Issue #25 you mentioned seems to address a different problem -- Supersonic shouldn't interfere with the title tags at all. If I fail to see how a better prefix indication could help to fix #25 as well, please let me know. Otherwise, I'd treat those issues separately.

trapexit commented 12 years ago

I was only using #25 as an example of being too clever for it's own good. Off hand I can't think of any particular case were it shouldn't be able to handle it automatically. I'm just trying to cover bases. Not a fan of non-configurable assumptions. The implementation should probably be able to handle bands that have non-alpha numeric band names. ( sic ), -OZ-, :Wumpscut:, :zovietfrance:, shels, etc.

timoreimann commented 12 years ago

Gotcha. Your band name examples should come in quite handy when this feature's implementation is to be quality-assured through a variety of unit-tests.