Author Topic: Artist separation (repeat rules) - Bug?  (Read 27441 times)

HMC

  • Full Member

  • Offline
  • ***
  • 181
Artist separation (repeat rules) - Bug?
« on: June 30, 2014, 08:49:01 PM »
So I found that radiodj doesn't group all the artists together so the repeat rules aren't completely working. If you have 5 titles by the same artist but one of them features another artist, Radiodj treats that as a different artist and then the repeat rules don't work. This is very important for licencing regulations.

example

Jennifer Lopez - I Luh Ya Papi
Jennifer Lopez f. Pitbull - Live it up

This is the same artist but Radiodj treats that as two different artists. I have had it play songs within a couple of songs of each other. Hopefully this can be updated to handle other artist in the artist title. Like if it contains f. or feat. or featuring maybe.

Thanks
Radio DJ 1.7.5 Update with MariaDB 10

joshuatree44

  • Guest
Re: Artist separation (repeat rules) - Bug?
« Reply #1 on: June 30, 2014, 09:16:40 PM »
This is an easy fix. Just take the ft artist name and put it next to the title so the artist is correct. That has been my fix thus far. Yah it does not look right but heck it works.

HMC

  • Full Member

  • Offline
  • ***
  • 181
Re: Artist separation (repeat rules) - Bug?
« Reply #2 on: June 30, 2014, 10:37:25 PM »
This is an easy fix. Just take the ft artist name and put it next to the title so the artist is correct. That has been my fix thus far. Yah it does not look right but heck it works.

Thanks but it should be handled inside radiodj. It should be just another check when parsing the metadata. I can't edit all my files. That's how they come. If you have 1000's of songs, that's just not a good solution without creating a lot more work for you.

I'm making my own Android app for my station and I've had to parse the string to strip anything after and including the "f.". Because when querying Last.fm API for the album art, it often won't find it usually unless it's just the artist by itself. It shouldn't be difficult to do in RDJ.

That way it will be grouped properly in the categories.
Radio DJ 1.7.5 Update with MariaDB 10

joshuatree44

  • Guest
Re: Artist separation (repeat rules) - Bug?
« Reply #3 on: July 01, 2014, 02:27:39 PM »
I have over 2000 files here and if I have to edit them, I do it. Not afraid to put in some work. Also, I am using the Amazon ID for cover art but it never picks it out. Not worried about it, but it would be nice to have it show up. I know TuneIn.com works just fine with the changes. That is just a relay service for the most part. Just have to be willing to put in the time.

HMC

  • Full Member

  • Offline
  • ***
  • 181
Re: Artist separation (repeat rules) - Bug?
« Reply #4 on: July 01, 2014, 05:48:07 PM »
I have over 2000 files here and if I have to edit them, I do it. Not afraid to put in some work. Also, I am using the Amazon ID for cover art but it never picks it out. Not worried about it, but it would be nice to have it show up. I know TuneIn.com works just fine with the changes. That is just a relay service for the most part. Just have to be willing to put in the time.

Sorry but I disagree. It's not about putting in extra work. It's not correct. I shouldn't have to reformat my titles which then will be incorrect when it's displayed. The featured artist should be listed with the artist not in the title of the song. So I'm not going to change that because it will also not show correctly on my mobile apps.  The majority of my album covers work with Last.fm if there is one available. However there isn't always an image available. I haven't tried Amazon. I might as a backup in case Last.fm doesn't have it.
I would like to see this fixed with RDJ to organize them together.
Radio DJ 1.7.5 Update with MariaDB 10

joshuatree44

  • Guest
Re: Artist separation (repeat rules) - Bug?
« Reply #5 on: July 01, 2014, 05:52:50 PM »
I see no reason to change since it displays what I want. So far none of the services I use has had issues with me doing what I have been. I think we can get picky to nitpick. I just dont see the need for this at the moment. I think there might be bigger fish to fry for Marius. Everything we think is easy to do in programming might not be the case for Marius. It might cost him more man hours than he wants to spend on it.

HMC

  • Full Member

  • Offline
  • ***
  • 181
Re: Artist separation (repeat rules) - Bug?
« Reply #6 on: July 01, 2014, 06:26:05 PM »
I see no reason to change since it displays what I want. So far none of the services I use has had issues with me doing what I have been. I think we can get picky to nitpick. I just dont see the need for this at the moment. I think there might be bigger fish to fry for Marius. Everything we think is easy to do in programming might not be the case for Marius. It might cost him more man hours than he wants to spend on it.

I understand what you're saying but if someone runs a "legal" station you have to abide by DMCA copyright rules and so that you don't play artists back to back or within a certain time frame.  The thing is, I'd like the artists to be all be grouped even if they feature another artist. I do dev work myself on the web site, PHP and also working on Java/Android so I know it can be done probably without to much effort to just ignore the featured artist when importing into the database. If there was more I could do I would. I think RDJ is a good tool and it rivals even the most professional software. I'm just trying to help it be even better. Many requests are just luxury but this i'm asking is more to fix an import issue IMO. It's not feasible if you have 30,000  songs and some people do.
Radio DJ 1.7.5 Update with MariaDB 10

joshuatree44

  • Guest
Re: Artist separation (repeat rules) - Bug?
« Reply #7 on: July 01, 2014, 06:36:54 PM »
well put in the requests bin not here. I know that it has been brought up before. Marius will do what he can but I would just suggest doing what I am doing or creating a playlist so the artists dont repeat. I think if Marius would have done it by now if it was an easy fix. I think there is more than this that is on the top of his plate right now. Just post it in the features or requests forum and Marius will do it if he can. But for now you look like your stuck.

Marius

  • Administrator
  • Hero Member

  • Offline
  • *****
  • 5741
    • Radio DJ
Re: Artist separation (repeat rules) - Bug?
« Reply #8 on: July 01, 2014, 09:35:37 PM »
Like i said already, currently there is no solution for that.
Now the played tracks and artists are handled by a MySQL procedure and not inside the program, so even if we somehow split the artist string using sql, the artist field will have to be separated using a standard, so a manual edit to all the tracks cannot be avoided.
DOWNLOADS PAGE

HOW TO FIX RADIODJ DATABASE
----------------
Please don't PM me for support requests. Use the forums instead.

HMC

  • Full Member

  • Offline
  • ***
  • 181
Re: Artist separation (repeat rules) - Bug?
« Reply #9 on: July 01, 2014, 10:21:17 PM »
Like i said already, currently there is no solution for that.
Now the played tracks and artists are handled by a MySQL procedure and not inside the program, so even if we somehow split the artist string using sql, the artist field will have to be separated using a standard, so a manual edit to all the tracks cannot be avoided.

Ok, I didn't know how your program worked. I assumed the program read the metadata data or the filename during import. That is where I thought the string manipulation could be handled. Because what code is reading this metadata info? Anyway, I don't recall you mentioning you couldn't fix this before.   :-X

Thanks
Radio DJ 1.7.5 Update with MariaDB 10

Marius

  • Administrator
  • Hero Member

  • Offline
  • *****
  • 5741
    • Radio DJ
Re: Artist separation (repeat rules) - Bug?
« Reply #10 on: July 01, 2014, 10:26:51 PM »
There are many topics with this subject.  :)
DOWNLOADS PAGE

HOW TO FIX RADIODJ DATABASE
----------------
Please don't PM me for support requests. Use the forums instead.

AndyDeGroo

  • Guest
Re: Artist separation (repeat rules) - Bug?
« Reply #11 on: July 03, 2014, 03:06:30 AM »
There is an easy hack to accomplish featured artist separation: Create a web script which receives now playing info from RadioDJ and use regex to find and update artist_played timestamp fields in database. Should be easy be to update both, main artist and featured artist.

PHP code example:
Code: [Select]
// ...
$artist_name = isset($_POST['artist'])? $_POST['artist'] : '';
$search = '/^(.+)\s+(feat|f)\.?\s+(.+)$/i';
preg_match($search, $artist_name, $matches);
if(isset($matches[1]) && isset($matches[3])) {
    $main_artist = trim($matches[1]);
    $feat_artist = trim($matches[3]);
    // Check if the matches are not empty. Otherwise the query will update all songs in database
    if(!empty($main_artist) && !empty($feat_artist)) {
        // escape values before placing them in query
        $main_artist = $DB->escape($main_artist); // I'm using ezSQL library. $DB is global instance of ezSQL_mysqli class
        $feat_artist = $DB->escape($feat_artist);
        // Note: Updating with LIKE '%artist name%' might be slow, but there is no better option
        $sql = "UPDATE `songs` SET `artist_played` = NOW() WHERE `artist` LIKE '%$main_artist%' OR `artist` LIKE '%$feat_artist%'";
        $DB->query($sql);
    }
}
// ...
Note: I wrote this code with minimal testing. There could be some problems in cases like "Queen feat. David Bowie" also updating "Queens of Stone Age" and other artists that match '%Queen%'.

If you already have a script that receives now playing info from RDJ, you could add this or similar logic to that script.

Marius

  • Administrator
  • Hero Member

  • Offline
  • *****
  • 5741
    • Radio DJ
Re: Artist separation (repeat rules) - Bug?
« Reply #12 on: July 03, 2014, 10:38:06 AM »
Thanks Andy, you eat MySQL on breakfast from what i remember :) there is not possible to accomplish that in the procedure?
I would really hate to move again the code inside the program and using php is complicated for many users.

I found this example to split the string:
http://code-cocktail.in/mysql-split-string-in-query/
DOWNLOADS PAGE

HOW TO FIX RADIODJ DATABASE
----------------
Please don't PM me for support requests. Use the forums instead.

HMC

  • Full Member

  • Offline
  • ***
  • 181
Re: Artist separation (repeat rules) - Bug?
« Reply #13 on: July 03, 2014, 11:24:42 AM »
Thanks Andy, you eat MySQL on breakfast from what i remember :) there is not possible to accomplish that in the procedure?
I would really hate to move again the code inside the program and using php is complicated for many users.

I found this example to split the string:
http://code-cocktail.in/mysql-split-string-in-query/

That's actually very cool.  I'm used to using PHP/MySQL, so I usually do my string functions with PHP before inserting them into the the DB. I didn't know it could be done in the query. But it makes since because you can do other manipulations, just never had a reason I guess.

This would be very awesome if it can be done. If knew more about stored procedures I'd be more helpful. :/
I don't think you can in a procedure but there is a function that might help.

http://www.montrealseocompany.com/2012/04/17/mysql-split-string-into-rows-function/
Radio DJ 1.7.5 Update with MariaDB 10

AndyDeGroo

  • Guest
Re: Artist separation (repeat rules) - Bug?
« Reply #14 on: July 03, 2014, 11:46:06 AM »
@Marius: I didn't mean that you should implement it in RDJ. It was intended as a quick and dirty hack for particular case. I'm not sure if splitting will work, because you still have to store found artist names as variables and "feat" separator can differ.
Few examples from my DB: "Alex Barck Feat. Jonatan Bäckelie", "Boris Dlugosch ft. Róisín Murphy", "Riton feat Meleka". Besides, there are those cases where one artists name match part in other name (e.g. '%Queen%' will match 'Queens of Stone Age'). There are also some other variations with "vs" like "DJ Fresh VS Diplo Feat. Dominique Young Unique" for mashups. It woulb be easier if only MySQL supported splitting strings using regex.

I assume that HMC will understand how to use the code based on following:
I do dev work myself on the web site, PHP and also working on Java/Android so I know it can be done probably without to much effort to just ignore the featured artist when importing into the database.

That aside, this kind of separation could be implemented by storing main artists name as separate field in songs table and using that for timestamp updates. The main artists name could be parsed using regex from filename/ID3 tag when importing tracks. The name could be user-editable in track editor.