RadioDJ - Free Radio Automation Software Forum

RadioDJ v1.7+ => v1.7+ - Support Forum => Topic started by: HMC on June 30, 2014, 08:49:01 PM

Title: Artist separation (repeat rules) - Bug?
Post by: HMC 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
Title: Re: Artist separation (repeat rules) - Bug?
Post by: joshuatree44 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.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC 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.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: joshuatree44 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.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC 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.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: joshuatree44 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.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC 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.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: joshuatree44 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.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius 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.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC 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
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius on July 01, 2014, 10:26:51 PM
There are many topics with this subject.  :)
Title: Re: Artist separation (repeat rules) - Bug?
Post by: AndyDeGroo 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.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius 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/ (http://code-cocktail.in/mysql-split-string-in-query/)
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC 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/ (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/ (http://www.montrealseocompany.com/2012/04/17/mysql-split-string-into-rows-function/)
Title: Re: Artist separation (repeat rules) - Bug?
Post by: AndyDeGroo 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.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC on July 03, 2014, 12:02:49 PM
@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:
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.

Yeah, I haven't messed with the now playing at all. Doing it with PHP will be quite hackish but might just work. I'll have to play with it and see what I can come up with. It would seem I'd have to check every song that is played with this method. Thanks for the suggestion for now.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius on July 03, 2014, 01:32:14 PM
@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.

Very true, but looking to your php script, you do it in the same way:
Code: [Select]
[...] WHERE `artist` LIKE '%$main_artist%' OR `artist` LIKE '%$feat_artist%'"
So Queen will match any artist containing the Queen string.

Another dirty workaround would be to add more columns for artists, but again there are tracks with 2, 3 and even more artists and sooner or later there will be complains if this method will be implemented.

Ideally i guess that it would be not to have at all in songs table the artist and to have 2 tables something like:

Code: [Select]
artists:
ID|artist

Code: [Select]
artists_data
ID|artistID|songID

And then just simply auto assign and add if it's the case the artists from a list. And in the program i can write a function to correctly split the artist with more separators that are used today.
But it will complicate the queries very much and for me the joins are a pain.  :D
Title: Re: Artist separation (repeat rules) - Bug?
Post by: AndyDeGroo on July 03, 2014, 02:41:55 PM
Very true, but looking to your php script, you do it in the same way:
Code: [Select]
[...] WHERE `artist` LIKE '%$main_artist%' OR `artist` LIKE '%$feat_artist%'"
So Queen will match any artist containing the Queen string.
I already mentioned that directly below the code. :)
It gets even crazier with artist names like "MO" which would match many artists. Oh, and "Air".

Another dirty workaround would be to add more columns for artists, but again there are tracks with 2, 3 and even more artists and sooner or later there will be complains if this method will be implemented.
That would be the easiest workaround, but it does not scale.

Ideally i guess that it would be not to have at all in songs table the artist and to have 2 tables something like:

Code: [Select]
artists:
ID|artist

Code: [Select]
artists_data
ID|artistID|songID

And then just simply auto assign and add if it's the case the artists from a list. And in the program i can write a function to correctly split the artist with more separators that are used today.
But it will complicate the queries very much and for me the joins are a pain.  :D
This would be the way to do it, but yes, it will complicate things. If you are going to test this idea, it would be better to store `artist_played` timestamp in artists table.
When I start to think about it, there could be even more problems to solve when it comes to "The Beatles", "Beatles, The" and just "Beatles". Although those should be solved before importing.

But you are already using joins for selecting songs for queue. :)
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC on July 06, 2014, 09:55:19 PM
@Andy,

By the way, looking at your PHP script, I think you miss understood my problem with Artist separation. Take my initial example

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

I don't care about the featured artist. The problem is RDJ see's this as two different artists when in fact, it's just one, Jennifer Lopez. The featured artist is irrelevant. So if I play the first track, it shouldn't play another Jennifer Lopez song( as the main artist) based on how long my repeat rules are. But since RDJ thinks "Jennifer Lopez f. Pitull" is a different artist, it will pick that and ignore my repeat rules.

That's all that matters. If I had to play based on Featured artist it'd be difficult because people like Pitbull is featured in every track these days. LOL

So I'm not trying to make it overly complicated. It just needs to account for artists that have features and group them as a single artist, the fact that they have a feature should be irrelevant.

Jennifer Lopez - Some song
Jennifer Lopez f. Some artist - another song
Jennifer Lopez f. another artist - yet another song

All 3 of those should be grouped together as Jennifer Lopez as the artist. Ignoring the feature. Then repeat rules will work correctly.


I hope that's a bit more clear now what the original issue is.

Title: Re: Artist separation (repeat rules) - Bug?
Post by: ncborges on July 06, 2014, 10:18:50 PM

Jennifer Lopez - Some song
Jennifer Lopez f. Some artist - another song
Jennifer Lopez f. another artist - yet another song

All 3 of those should be grouped together as Jennifer Lopez as the artist. Ignoring the feature. Then repeat rules will work correctly.


I hope that's a bit more clear now what the original issue is.

 It's VERY clear and I agree with you. It's a great request and you're right about repeat rules

+ :ok: :ok: :ok:1
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius on July 06, 2014, 11:36:01 PM
@HMC: If the things were be just so simple also in programming...

First, if you would ignore the featured artist, you would have a big problem. There are many artists who sing mostly with other artists, eg. "Pitbull" and i'm sure you would hate to hear 3-4 tracks one after another with that artist.

Second, the solution is not simple at all, in the latest version anyone is able to edit the update track and artist procedure and i already wrote on other topics that i don't have a solution for this issue and if someone more advanced in MySQL can give me a solution, i will implement it and until now no one did. With a few occasions i exchanged some PM's with AndyDeGroo and trust me that he's no beginner when it comes to sql.

Third: For your example:

Jennifer Lopez - Some song
Jennifer Lopez f. Some artist - another song
Jennifer Lopez f. another artist - yet another song

In programming you would have to split the artist correctly, because for a computer is not so obvious what that string is representing and this raises another problem because there is no standard when it comes for naming tracks.

"Jennifer Lopez f. Some artist" can be "Jennifer Lopez, Some artist ", "Jennifer Lopez feat. Some artist", "Jennifer Lopez featuring Some artist", "Jennifer Lopez & Some artist" etc.
So even to obtain the principal artist, you have to think to all scenarios first, because you will encounter many different situations.

I'm still open to solutions.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius on July 07, 2014, 12:17:49 AM
PS: i'm testing something now that it may work. I will post the results.

PS: We will need to put together a list of used separators and to think them well.
For eg on some tracks i've seen the artists separated with the "and" or "&" symbol, but there are also many bands which are containing that symbol "Belle & Sebastian", "Iron & Wine" etc and using these keywords/symbols as separators could lead to unwanted results, so i think that we should limit to "feat." and "featuring" which are more clear that are separating the actual artists.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC on July 07, 2014, 12:49:28 AM
@HMC: If the things were be just so simple also in programming...

First, if you would ignore the featured artist, you would have a big problem. There are many artists who sing mostly with other artists, eg. "Pitbull" and i'm sure you would hate to hear 3-4 tracks one after another with that artist.

Second, the solution is not simple at all, in the latest version anyone is able to edit the update track and artist procedure and i already wrote on other topics that i don't have a solution for this issue and if someone more advanced in MySQL can give me a solution, i will implement it and until now no one did. With a few occasions i exchanged some PM's with AndyDeGroo and trust me that he's no beginner when it comes to sql.

Third: For your example:

Jennifer Lopez - Some song
Jennifer Lopez f. Some artist - another song
Jennifer Lopez f. another artist - yet another song

In programming you would have to split the artist correctly, because for a computer is not so obvious what that string is representing and this raises another problem because there is no standard when it comes for naming tracks.

"Jennifer Lopez f. Some artist" can be "Jennifer Lopez, Some artist ", "Jennifer Lopez feat. Some artist", "Jennifer Lopez featuring Some artist", "Jennifer Lopez & Some artist" etc.
So even to obtain the principal artist, you have to think to all scenarios first, because you will encounter many different situations.

I'm still open to solutions.

I understand what you're saying and that's true you don't want featured artist in back to back songs either. I do programming so I understand the problems you face with not having a common delimiter which sucks. For me I know mine will almost always be "f." so if I created a php function it would be easy to explode the string.

Maybe you can give the user the option to group it and they can input their own delimiter. I know it's not easy coming up with a solution and thank you for trying. 

Maybe you can use nested MySQL, Insert, then select and compare using IF then. Something like Select the artist if it is Like then insert or do something else.
I've had to do some pretty complex queries before and can get my answer using on StackOverflow. There are some pretty good MySQL geniuses there.

Something like this http://stackoverflow.com/questions/5656030/mysql-if-select-then-insert (http://stackoverflow.com/questions/5656030/mysql-if-select-then-insert)
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC on July 07, 2014, 12:52:03 AM
PS: i'm testing something now that it may work. I will post the results.

PS: We will need to put together a list of used separators and to think them well.
For eg on some tracks i've seen the artists separated with the "and" or "&" symbol, but there are also many bands which are containing that symbol "Belle & Sebastian", "Iron & Wine" etc and using these keywords/symbols as separators could lead to unwanted results, so i think that we should limit to "feat." and "featuring" which are more clear that are separating the actual artists.

Yes, that could work. Mine happen to be "f." which are how I receive them. Maybe it could be read from XML and we can add the delimiter we need like a setting. Just a thought.

Edit:
I agree, a feature delimiter should be the limit. There are too many other variations. To me something Artist Vs Artist is a collaboration/mashup and to me is not a single artist.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: FL Coast on July 07, 2014, 01:00:15 AM
PS: i'm testing something now that it may work. I will post the results.

PS: We will need to put together a list of used separators and to think them well.
For eg on some tracks i've seen the artists separated with the "and" or "&" symbol, but there are also many bands which are containing that symbol "Belle & Sebastian", "Iron & Wine" etc and using these keywords/symbols as separators could lead to unwanted results, so i think that we should limit to "feat." and "featuring" which are more clear that are separating the actual artists.

From Wikipedia, the free encyclopedia

In pop music, guest appearances are often described with the words featuring, with, or and. It is abbreviated in credit lists as Feat., Ft., f/, f.

Those are the main ones I have seen, but I have also seen w/ (instead of with).
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius on July 07, 2014, 01:03:35 AM
I made some tests and got some great results, but due the limitations of sql language, all the string handling will be made inside the program.

Until now, the function i tested allows you to have unlimited artists as long you don't mix the separators, so something like:
"Madonna & Justin Timberlake featuring Other Artist" will not work, but it can be modified if needed.

I also thought to a customizable list, but it will need to be edited with precautions otherwise the tracks will not be updated properly.

@FL Coast: single letter separators not followed by a distinct punctuation will cause detection problems and possible unwanted splits. I would avoid using "f" or "w".
Title: Re: Artist separation (repeat rules) - Bug?
Post by: FL Coast on July 07, 2014, 01:19:12 AM
@FL Coast: single letter separators not followed by a distinct punctuation will cause detection problems and possible unwanted splits. I would avoid using "f" or "w".

Sorry if I missed a punctuation.

Feat.
Ft.
f/
f.
w/
Title: Re: Artist separation (repeat rules) - Bug?
Post by: kebmo18901 on July 07, 2014, 02:14:30 AM
I don't have a great knowledge of MySQL, but could something like this work? Your artist being The Beatles for example. Let's just say the artist is placed in Column B of MySQL (Column A being the song title). Now you would add your "related artists". In Column C-Paul McCartney, In D-John Lennon, In E-George Harrison & In F-Ringo Starr. Then have RadioDJ, using the artist repeat rules, not play the same artists from Columns B through F.
You may have to enter the info for each particular song. If the artist is Tim McGraw, you should be able to play a Faith Hill song after. But if the artist is Tim McGraw & Faith Hill, you shouldn't be able to play a Tim McGraw OR a Faith Hill song using the artist repeat rules.
I don't know if I made this more complicated with my explanation. Only throwing out suggestions..
Title: Re: Artist separation (repeat rules) - Bug?
Post by: AndyDeGroo on July 07, 2014, 05:50:37 AM
By the way, looking at your PHP script, I think you miss understood my problem with Artist separation. Take my initial example

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

I don't care about the featured artist.
Just edit the PHP script to fit your needs. All you have to edit is $sql variable to exclude featured artist and match at the beginning of artist's name:
Code: [Select]
$sql = "UPDATE `songs` SET `artist_played` = NOW() WHERE `artist` LIKE '$main_artist%'";
That will update only main artist's name and RDJ will exclude those tracks. I just realized that the script could use preg_split instead of preg_match.

First, if you would ignore the featured artist, you would have a big problem. There are many artists who sing mostly with other artists, eg. "Pitbull" and i'm sure you would hate to hear 3-4 tracks one after another with that artist.
That is exactly why I added the featured artist update to my PHP code.

Second, the solution is not simple at all, in the latest version anyone is able to edit the update track and artist procedure and i already wrote on other topics that i don't have a solution for this issue and if someone more advanced in MySQL can give me a solution, i will implement it and until now no one did. With a few occasions i exchanged some PM's with AndyDeGroo and trust me that he's no beginner when it comes to sql.
I agree that there is no simple solution to this problem. Thank you, Marius, for your kind words. Truth is, I know a bit about SQL, but I'm no genius. :)

I wrote and tested a crude SQL procedure, but it still has same problem of matching irrelevant artists. It takes a fixed delimiter string as second argument, but the string is case-sensitive:
Code: [Select]
DELIMITER $$
CREATE PROCEDURE UpdateFeatured( trackID INT, delimStr VARCHAR(15) )
BEGIN

SET @Artist = ( SELECT `artist` FROM `songs` WHERE ID = trackID );
# Find main artist by splitting artist
SET @mainArtist = SUBSTRING_INDEX( @Artist, delimStr, 1 );
# Check if mainArtist was found
IF (@mainArtist != @Artist) THEN
# Find featured artist
SET @featArtist = SUBSTRING( @Artist, POSITION(delimStr IN @Artist )+CHAR_LENGTH(delimStr));
# Update matching entries
UPDATE `songs` SET `artist_played` = NOW()
WHERE `artist` LIKE CONCAT(@mainArtist, '%')
OR `artist` LIKE CONCAT(@featArtist, '%');
END IF;

END$$
DELIMITER ;

Note: It will also update featured artist, but can be adapted for updating only main artist. Also the delimiter has to contain spaces on both ends or it won't work.

The procedure could be called from UpdateTracks procedure like this:
Code: [Select]
CALL UpdateFeatured(4242, ' feat. ');

OR part of it could be merged into UpdateTracks procedure if someone really wants it.

PS: We will need to put together a list of used separators and to think them well.
For eg on some tracks i've seen the artists separated with the "and" or "&" symbol, but there are also many bands which are containing that symbol "Belle & Sebastian", "Iron & Wine" etc and using these keywords/symbols as separators could lead to unwanted results, so i think that we should limit to "feat." and "featuring" which are more clear that are separating the actual artists.

Based on what I've seen, the splitting regex could be:
Code: [Select]
/ (f|ft|feat|featuring)[\.;\/]? /
If it is anything to go by, MusicBrainz database contains 1400+ artists with "and" and "&" (http://musicbrainz.org/search?query=and&type=artist&method=advanced). So those two string are not an option for this purpose.

IMO, the assigned artists should be editable in track editor. Advanced users could then edit those entries to achieve the effect they need. There also should be an option to enable the splitting feature which would be disabled by default to use current artist separation logic.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC on July 07, 2014, 06:00:19 AM

Code: [Select]
DELIMITER $$
CREATE PROCEDURE UpdateFeatured( trackID INT, delimStr VARCHAR(15) )
BEGIN

SET @Artist = ( SELECT `artist` FROM `songs` WHERE ID = trackID );
# Find main artist by splitting artist
SET @mainArtist = SUBSTRING_INDEX( @Artist, delimStr, 1 );
# Check if mainArtist was found
IF (@mainArtist != @Artist) THEN
# Find featured artist
SET @featArtist = SUBSTRING( @Artist, POSITION(delimStr IN @Artist )+CHAR_LENGTH(delimStr));
# Update matching entries
UPDATE `songs` SET `artist_played` = NOW()
WHERE `artist` LIKE CONCAT(@mainArtist, '%')
OR `artist` LIKE CONCAT(@featArtist, '%');
END IF;

END$$
DELIMITER ;

Could you not use iLike to make it case insensitive?
Title: Re: Artist separation (repeat rules) - Bug?
Post by: AndyDeGroo on July 07, 2014, 06:54:55 AM
Could you not use iLike to make it case insensitive?

It is not the update part which is case sensitive. SUBSTRING_INDEX() (http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_substring-index) performs a case-sensitive match when searching for delim.

I just realised that to find case-insensitive delimiter, the procedure must be changed:
Code: [Select]
DELIMITER $$
CREATE PROCEDURE UpdateFeatured( trackID INT, delimStr VARCHAR(15) )
BEGIN

SET @Artist = ( SELECT `artist` FROM `songs` WHERE ID = trackID );
# Find main artist by splitting artist
SET @mainArtist = SUBSTRING( @Artist, 1, POSITION( delimStr IN @Artist ));
# Check if mainArtist was found
IF (@mainArtist != @Artist) THEN
# Find featured artist
SET @featArtist = SUBSTRING( @Artist, POSITION(delimStr IN @Artist )+CHAR_LENGTH(delimStr));
# Update matching entries
UPDATE `songs` SET `artist_played` = NOW()
WHERE `artist` LIKE CONCAT(@mainArtist, '%')
OR `artist` LIKE CONCAT(@featArtist, '%');
END IF;

END$$
DELIMITER ;

Btw, you can search case-insensitive with LIKE if database collation is case-insensitive like "utf8_general_ci".
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius on July 07, 2014, 09:52:22 AM
Ok, managed to split the artist which contains mixed separators.

At this point AndyDeGroo, i could do the inserts in a loop, or even better to avoid multiple queries, i could build the string using a single separator and then send it to your procedure which would handle the tables update.

PS: The cases when there are more than 2 artists are pretty rare, so i think that even updating from the loop would work just fine, because the procedure would be complicated to support unlimited artists.

[attachment deleted by admin]
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Jhonny on July 07, 2014, 11:03:40 AM
I think that problems will arise with the name

Tom & the band, it's a group name


grtz.

Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC on July 07, 2014, 11:14:01 AM
Ok, managed to split the artist which contains mixed separators.

At this point AndyDeGroo, i could do the inserts in a loop, or even better to avoid multiple queries, i could build the string using a single separator and then send it to your procedure which would handle the tables update.

PS: The cases when there are more than 2 artists are pretty rare, so i think that even updating from the loop would work just fine, because the procedure would be complicated to support unlimited artists.

Nice work. One more scenario I've seen and even have my self is features separated by a comma.

Justin Timberlake f. Jay-z, some artist, another artist & last artist
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius on July 07, 2014, 11:30:23 AM
Comma shouldn't be a problem, but as i said before both "and" and "&" will be, because they can be found also in some band names, so it would be wise to exclude them from the list.
For me it's clear that for optimal results, the user will have to do a little edits in some cases.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC on July 07, 2014, 12:13:37 PM
Comma shouldn't be a problem, but as i said before both "and" and "&" will be, because they can be found also in some band names, so it would be wise to exclude them from the list.
For me it's clear that for optimal results, the user will have to do a little edits in some cases.

If you can get 90% of most cases about like you've gotten it. I think we(I) would be able to live with that. There will always be some exceptions and then we can manually edit those.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Jhonny on July 07, 2014, 12:41:56 PM
60% is enough
 With use of the track manager it is certainly fast adjusted.

J.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: AndyDeGroo on July 07, 2014, 02:28:07 PM
Ok, managed to split the artist which contains mixed separators.

At this point AndyDeGroo, i could do the inserts in a loop, or even better to avoid multiple queries, i could build the string using a single separator and then send it to your procedure which would handle the tables update.

PS: The cases when there are more than 2 artists are pretty rare, so i think that even updating from the loop would work just fine, because the procedure would be complicated to support unlimited artists.
I don't see how your split artist name strings could be passed to my procedure. If you read trough it, it takes track ID as first argument, gets artist's name from that song entry and splits the name by single separator specified by second argument. There is no need to for procedure if you have already separated the artists.

`artist_played` timestamps can be updated in one query. All you have to do is concatenate OR `artist` LIKE 'Artists Name%' to the query string.

You should add another to split strings if you are using String.Split instead of Regex.Split: "ft;"
I see it in my database as "John Legend ft;  The Roots & Questlove".

IMO, you should use Regex.Split with '\s+(f|ft|feat|&|and)[\.;\/]?\s+', because it covers cases with different punctuation.

Here is an SQL query to see how many artists you can find with similar regex in your database:
Code: [Select]
SELECT `artist`, `artist_played`
FROM `songs`
WHERE `artist` REGEXP '.+ (f|ft|feat|&|and)[\.;\/]? .+'
GROUP BY `artist`;
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius on July 07, 2014, 02:45:29 PM
Your procedure only accepts one separator, that's why i said that after i separate the artists that have mixed separators i can then send a string like artist1;artist2 etc and then you will simply split to a known character.

However, after a few tests i will not complicate things. I simply compose the query in the loop and i run it once with the procedure call, so i still use the existing connection.
The generated query looks like this:

Code: [Select]
CALL UpdateTracks(165,0,0,30,0);
UPDATE `songs` SET `artist_played`=NOW() WHERE `artist` LIKE '%Macklemore%';
UPDATE `songs` SET `artist_played`=NOW() WHERE `artist` LIKE '%Ryan Lewis%';
UPDATE `songs` SET `artist_played`=NOW() WHERE `artist` LIKE '%Ray Dalton%';

The good part is that the existing procedure can remain as it is and the users will not have to update again the database. You saw what a mess was when some users didn't updated properly.

About regex, string.split() accepts arrays and is far more easy for me to load them from a external file in which the user is able to add/remove split keywords, so i will use it.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: SnowHow on July 07, 2014, 05:53:20 PM
What a wonderful topic - I've been taking notes....  ;D

Three more separators that I have seen that I don't recall being mentioned:

vs

vs.

versus


(I never understood these - Are the artists in a battle?  :hihi: )


J-

Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC on July 07, 2014, 10:11:26 PM
What a wonderful topic - I've been taking notes....  ;D

Three more separators that I have seen that I don't recall being mentioned:

vs

vs.

versus


(I never understood these - Are the artists in a battle?  :hihi: )


J-

Honestly that seems something editable in the song details. I see Vs as mashups or collaborations and mostly in EDM music IMO. I look at those as one artist and most of the time some EDM music doesn't have vocals so who probably couldn't tell who was playing unless you are really familiar with the music.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC on July 07, 2014, 11:33:49 PM
BTW, I've been using a PHP script to time stamp the artists that Andy suggested to help with the separation. It's not working completely because there is a larger overall problem with the Autodj function.
During this discussion we've noticed that RDJ sees these as different artists.

Pitbull f. Danny Mercer - Outta Nowhere
Pitbull f. G.R.L - Wild Wild Love

Well after "Pitbull f. Danny Mercer - Outta Nowhere" plays, the PHP script goes and time stamps all the Pitbull and featuring Pitbull songs. However since autodj already created the playlist there are 3 other songs already in the playlist with Pitbull in it. Autodj loads many tracks at once so I don't how the separation is going to completely work with Autodj selecting that many tracks at once. Since it's already queued, those songs still play.  Sorry to find more problems.  :(
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius on July 08, 2014, 07:44:43 AM
There are two different artist/track checks that are made by AutoDJ:
1. It selects only files which have the track and artist played date and time older or equal to the user set repeat duration;
2. It checks if the track or artist is not already in the queue.

All things that has been discussed on this topic affects the first check, because only when a track gets played the track and artist played date and time are updated.
To the second check the problem is bigger, because it compares directly the artist fields from the database (ignore all the tracks from the songs table where the artist is found in the queue).

If i would update the track and artist played in the moment when i add a file to the playlist, if you would delete the file from the playlist, the file would still be marked as played (so it would need to wait until it would pass by the first check), beside that all tracks from a playlist would have the same played time which would be very bad for reports.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius on July 08, 2014, 08:06:32 AM
Ok, i think that i found a workaround also to the second check, but i will need some testing.
The modified RadioDJ.exe can be downloaded from here: http://radiodj.ro/tests/RadioDJTest.zip
The archive also has a .txt file which contains the artist separators. Put both files in RadioDJ folder.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC on July 08, 2014, 12:54:58 PM
Ok, i think that i found a workaround also to the second check, but i will need some testing.
The modified RadioDJ.exe can be downloaded from here: http://radiodj.ro/tests/RadioDJTest.zip
The archive also has a .txt file which contains the artist separators. Put both files in RadioDJ folder.

Cool, I'll test it out. I didn't realize the program was so small. 1.5MB?  ???. Anyway, will I have to reimport music or will it just know based on the .txt file with the separators?
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius on July 08, 2014, 01:03:05 PM
Just replace the exe with the new one and add the txt file.
If you already downloaded the file, please delete it and download this: http://radiodj.ro/tests/RadioDJTest2.zip
It's more optimized.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC on July 08, 2014, 01:16:01 PM
The 2nd zip doesn't have the program. Just a config file. Also at first glance the playlist is listing songs incorrectly now with the test RDJ.

It choose 3 songs and the 2nd and 3rd song was the same.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: AndyDeGroo on July 08, 2014, 02:06:29 PM
Ok, i think that i found a workaround also to the second check, but i will need some testing.
The modified RadioDJ.exe can be downloaded from here: http://radiodj.ro/tests/RadioDJTest.zip
The archive also has a .txt file which contains the artist separators. Put both files in RadioDJ folder.

I'd like to test it, but first file "RadioDJTest.zip" is no longer available and second one doesn't contain RadioDJ.exe.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius on July 08, 2014, 02:40:20 PM
Sorry for that, i corrected the archive.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC on July 08, 2014, 03:18:47 PM
Ok I got the 2nd test. I'll have to test it this evening. Can't play right now. LOL. I'll report back what I find.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: AndyDeGroo on July 08, 2014, 04:36:20 PM
I tried to replace the RadioDJ.exe, but it was locked by svchost.exe as DLL handle even after exiting RDJ. The svchost.exe process is running local network restricted services an one of them is EventLog service. After restarting the EventLog service handle was released and I could replace RadioDJ.exe.
This must be related to my fiddling with registry keys for Event Log entries from RadioDJ. I wrote about that issue here (http://www.radiodj.ro/community/index.php?topic=4559.msg26513#msg26513). Somehow I didn't receive any satisfying answer to my questions.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: AndyDeGroo on July 08, 2014, 05:08:50 PM
I'm testing it now and it appears to be selecting same artist and even same track for queue.

Here is data from my queue after clearing and allowing to load new tracks:
Code: [Select]
The xx - Basic Space
The xx - Missing
Arcade Fire - Afterlife
Kings Of Leon - Manhattan
Florence + the Machine - Bird Song
The xx - Missing
5nizza - Я Тебя Вы...
Darwin Deez - Radar Detector
!!! - Wannagain Wannagain
Kings Of Leon - 17
Kings Of Leon - Camaro
Adele - Hometown Glory
Florence + the Machine - Bird Song
5nizza - Пятница
Kings Of Leon - Camaro
Florence + the Machine - Bird Song
Foster The People - Pumped Up Kicks (Bridge & Law Remix)
Dirty Projectors + Bjork - All We Are
Something is no right here.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius on July 08, 2014, 05:17:04 PM
About the logs, i use .NET way to write them (exactly like in the documentation: http://msdn.microsoft.com/en-us/library/xzwc042w%28v=vs.110%29.aspx) On some systems are required admin privileges to read/write them, maybe it's also your case, i really cannot say yet.

About the second issue, can you please check if your songs table has these 2 columns: "tdate_played" and "tartist_played"?
Title: Re: Artist separation (repeat rules) - Bug?
Post by: AndyDeGroo on July 08, 2014, 05:29:54 PM
About the logs, i use .NET way to write them (exactly like in the documentation: http://msdn.microsoft.com/en-us/library/xzwc042w%28v=vs.110%29.aspx) On some systems are required admin privileges to read/write them, maybe it's also your case, i really cannot say yet.
After adding mentioned registry keys, the messages appear in event logs. Only problem is that they have following text before actual message:
Code: [Select]
The description for Event ID 0 from source RadioDJ cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:
I'm not sure if I really had to set EventMessageFile to full path of RadioDJ.exe.

About the second issue, can you please check if your songs table has these 2 columns: "tdate_played" and "tartist_played"?
Yes, they are the last two columns. tartist_played gets updated but tdate_played does not. How and why does RDJ use those columns?
Title: Re: Artist separation (repeat rules) - Bug?
Post by: AndyDeGroo on July 08, 2014, 07:58:36 PM
I'm looking at MySQL general-log and I can see that `queuelist` is completely ignored when selecting songs for queue. In logfile from RadioDJ 1.6.5.7 there is LEFT JOIN `queuelist` to skip songs that are already in queue.

There is one thing that I don't understand and wanted to ask; Why RDJ does TRUNCATE `queuelist`; before inserting each track and then again inserts every track that is in queue? IMO, it is faster to just delete the track that is starting to play and keep the table populated. That would lead to less strain on database and better performance.

Update: I forgot to mention that featured artists are updated as expected. For "King Fantastic feat. AWOLNATION" RDJ does these queries:
Code: [Select]
UPDATE `songs` SET `artist_played`=NOW() WHERE `artist` LIKE '%King Fantastic%';
UPDATE `songs` SET `artist_played`=NOW() WHERE `artist` LIKE '%AWOLNATION%'

Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius on July 09, 2014, 12:43:03 PM
I will try to answer to your questions:

- The only reason why i need the queue table is to avoid to select duplicates when i generate the playlist from the rotation and i need an exact copy of the playlist that i have in the memory.
It's not only about deleting the playing track, but when a track is inserted to a specific position in the playlist, or they are drag & dropped, it would be far more complicated to reorder them in the queue table than truncate the table and then inserting a fresh copy of the playlist.

In order to sync them i would need to use more delete/insert commands on the table and as far as i know TRUNCATE is faster because  it doesn't keep any logs (http://stackoverflow.com/questions/20559893/comparison-of-truncate-vs-delete-in-mysql-sqlserver).

- For this test i tried another method to avoid duplicates and to be honest i don't understand why here is working flawlessly and there not. If i use the LEFT JOIN i can only exclude artists that are named exactly the same, which makes our existing featured artist separation method inefficient. Like i said before the featured artists are marked as played only when the track is actually played.

But what happens when the track is not played yet. Let's say that the first artist from the playlist is "Pitbull f. Danny Mercer" and the Auto DJ needs to add more tracks. If it will use the existing LEFT JOIN to see if the artist it's already in the queue table "Pitbull f. G.R.L." will be a valid result because this exact artist is not found, so we will end up with a duplicate artist.

So i tried a different approach and i removed the join and each time when i select a track, i split the featured artists and i update the "tartist_played" with the current date and time and when i select a new track i order the results also by the "tartist_played" ASC.

Maybe it's not the best method, but that's why i said that it's a test...

PS: Do you have rotation entries without repeat rules unchecked beside jingles?
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC on July 09, 2014, 06:37:57 PM
I had similar results where the playlist was duplicating songs. Like the same two songs. It was kinda weird.

e.g.

Artist 1 - song 1
Artist 2 - song 2
Artist 1 - song 1
Artist 1 - song 1
Artist 2 - song 2
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius on July 09, 2014, 07:16:10 PM
Ok, so this test failed for now. I'm still open to a better solution.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: AndyDeGroo on July 10, 2014, 01:57:01 PM
- The only reason why i need the queue table is to avoid to select duplicates when i generate the playlist from the rotation and i need an exact copy of the playlist that i have in the memory.
It's not only about deleting the playing track, but when a track is inserted to a specific position in the playlist, or they are drag & dropped, it would be far more complicated to reorder them in the queue table than truncate the table and then inserting a fresh copy of the playlist.

In order to sync them i would need to use more delete/insert commands on the table and as far as i know TRUNCATE is faster because  it doesn't keep any logs (http://stackoverflow.com/questions/20559893/comparison-of-truncate-vs-delete-in-mysql-sqlserver).
IIRIC, you already answered same question in PM. Yes, TRUNCATE is faster than DELETE.
Drag & drop sorting could be done by adding indexed sorting column on queuelist and then updating that when needed, but that would take some major changes in how RDJ handles queue. If RDJ maintained a queue in database, we could have queue which could be modified form outside.

So i tried a different approach and i removed the join and each time when i select a track, i split the featured artists and i update the "tartist_played" with the current date and time and when i select a new track i order the results also by the "tartist_played" ASC.

PS: Do you have rotation entries without repeat rules unchecked beside jingles?

I have 9 rotation entries set to "Least Recently Played", "Least Times Played" and "By Priority" and all have repeat rules enabled.
The approach doesn't work because `tartist_played` is second field in ORDER BY clause and the field is reset to identical values for same artist every time one is selected. To check this I tried following query for "Least Recently Played":
Code: [Select]
SELECT `songs`.`ID`, `songs`.`artist` FROM `songs`
WHERE `songs`.`enabled`=1 AND `id_subcat`=4
AND ((`start_date` <= Now()) AND (`end_date` >= NOW() OR `end_date` = '2002-01-01 00:00:01'))
AND (TIMESTAMPDIFF(MINUTE, `date_played`, NOW())>240 AND TIMESTAMPDIFF(MINUTE, `artist_played`, NOW())>240)
ORDER BY `date_played` ASC, `tartist_played` ASC, RAND() LIMIT 1
After trying to run select and update (with WHERE `artist` LIKE '%artist%'`) several time, select query is stuck between 3 artists on subsequent selects. Until `date_played` is updated, they get selected again and again depending on `date_played`.

For intended effect another part should be added to where clause:
Code: [Select]
AND TIMESTAMPDIFF(MINUTE, `tartist_played`, NOW())>240

I checked and it works.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius on July 10, 2014, 02:29:36 PM
Quote
AND TIMESTAMPDIFF(MINUTE, `tartist_played`, NOW())>240

If i would do this and the user switches on the autodj and then for a reason or another clears the playlist for that amount of time those tracks will not be played again. Even now, you see how many users think that they have enough tracks to support a long repeat intervals, but adding also this, could reduce dramatically the amount of autodj results.

We need something better...  :)

PS: in the first versions i kept the queue in the database, but is slow for small tracks when the changes are too quick and also the memory version of queue is holding much more data (cue points calculated in bytes and in seconds, the fades etc), all this so when a track is starting to spend less time to compute everything.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: AndyDeGroo on July 10, 2014, 07:49:03 PM
If i would do this and the user switches on the autodj and then for a reason or another clears the playlist for that amount of time those tracks will not be played again.
Right. I didn't thing about that scenario.

We need something better...  :)
I can't think of any other solution with current database structure.

Next best thing for featured artists separation would be creating artists table and pivot table to link artists to songs. That would add at least two more tables to song selection statement and take more work to maintain data integrity. The statement gets so complicate I can't wrap my mind around it without writing it down.
One thing is for sure - adding new tracks would not be as easy as it is now.

Easiest fix for now is to move all featured artist names to song titles. Unfortunately that is not perfect because featured artist would still be selected within no-repeat rule interval.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius on July 10, 2014, 08:16:08 PM
Hmm, i just got another idea. The rotation is generated pretty fast so, how about comparing tracks that have the tartist in a smaller time frame, like 5 minutes? In that way we can include this in the where clause. What do you think?
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Jhonny on July 10, 2014, 08:25:43 PM
I find this discussion really very good.
But with my simple brain.

If I have two artists who are not the same
Ben
and
Mark
they are two different singers
So two songs
but together they are also one song with a different sound

Why then these separate?

There are just three songs.

Or I do not understand what the goal is.

I think the DJ just have to make a sub for two artists sing one song.

And in a rotation he has the choice, or is that too simple.

Grtz...
Title: Re: Artist separation (repeat rules) - Bug?
Post by: AndyDeGroo on July 10, 2014, 08:55:42 PM
Hmm, i just got another idea. The rotation is generated pretty fast so, how about comparing tracks that have the tartist in a smaller time frame, like 5 minutes? In that way we can include this in the where clause. What do you think?
It sounds good in theory. There might be problems if there are too many entries in rotation list. Although I doubt that anyone has such a long rotation list.

Why then these separate?

There are just three songs.

Or I do not understand what the goal is.

I think the DJ just have to make a sub for two artists sing one song.

And in a rotation he has the choice, or is that too simple.

One could separate two-performer songs in subcategory if there are just few such songs in library. Take for instance some tracks by Drake:
Quote from: Tracks-by-Drake
Drake feat. 2 Chainz & Big Sean - All Me
Drake feat. Detail - 305 To My City
Drake feat. J. Cole - Jodeci Freestyle
Drake feat. James Fauntelroy - Girls Love Beyoncé
Drake feat. Majid Jordan - Hold On, We're Going Home
Drake feat. Sampha - Too Much
Any of those tracks are considered as performed by different artist in RadioDJ but they all are by Drake. You wouldn't want them to be played one after another. I hope this explains the issue.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Jhonny on July 10, 2014, 09:22:16 PM
Thanks Andy,

   So if I understand correctly sings Dreak with others artists
Or a song by another artist?

But Dreak sings several songs.

I've never seen faet in my songs.

grtz.


Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius on July 10, 2014, 09:22:59 PM
Ok, i made a test version with a time frame of 10 minutes. http://radiodj.ro/tests/RadioDJTest3.zip (http://radiodj.ro/tests/RadioDJTest3.zip)
Title: Re: Artist separation (repeat rules) - Bug?
Post by: AndyDeGroo on July 10, 2014, 10:08:01 PM
I'm testing. Selections seems to be ok. It seems to work so far.
Maybe this behaviour could be enabled by an option. Adding a warning about side effects.

Update: I wrote too soon. Artists are repeating again.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC on July 15, 2014, 08:01:08 AM
Ok, i made a test version with a time frame of 10 minutes. http://radiodj.ro/tests/RadioDJTest3.zip (http://radiodj.ro/tests/RadioDJTest3.zip)

I know you said you were releasing a new version soon. Will it have the artist separation in it that you tested at least? If you can't fix the playlist thing right now that's ok.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: bulik4lg on July 17, 2014, 10:48:23 AM
Easiest fix for now is to move all featured artist names to song titles. Unfortunately that is not perfect because featured artist would still be selected within no-repeat rule interval.

May be this can help..
I saw it yesturday while I was testing Station Playlist Creator. There is a table, where user fills "Primary artist" and can add as many "Secondary artists" as he/she wants.. The same logic is for tracks. The system always checks those settings before generating music. The only weird thing is, that the content of this table doesn´t work vice versa. So it means, each of secondary tracks needs to be added as a primary one as well, with the previous primary as secondary (for e.g.
Primary : Abba
Secondary : Agnetha Faltskog
than
Primary : Agnetha Faltskog
Secondary : Abba etc. - if you don´t do this, system checks separation rules only for the secondary following the primary artist, not the way round)
May be it´s too much complicated to implement this..
I really don´t know, how it works.. if it works with a database or if it is some kind of plugin or whatever. I just wrote, what I saw and tested yesturday with a trial version of SPC.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marvin on July 18, 2014, 05:41:20 PM
I'm seeing some same artist, same song repeat occasionally in much less than the artist separation I have set. I have many songs so it isn't a lack of song problem. Is this different from what is happening in this thread? Any known solution? (Using Version 1.7.0)

Marvin
Title: Re: Artist separation (repeat rules) - Bug?
Post by: AndyDeGroo on July 18, 2014, 08:18:55 PM
I'm seeing some same artist, same song repeat occasionally in much less than the artist separation I have set. I have many songs so it isn't a lack of song problem. Is this different from what is happening in this thread? Any known solution? (Using Version 1.7.0)
Maybe it is different. Hard to tell without example track listing. Could it be that you have artist names with subtle differences? For instance: "the Beatles", "The Beatles" and "Beatles" are seen as three different artists by RDJ.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marvin on July 19, 2014, 01:13:49 AM
No, I wish it were that simple. That is the first thing I checked. It was definitely the same file. I've caught it twice this week (not the same track both times, but separate instances where the a same file repeated twice. The first track repeated within 15 minutes. The one today was within about 80 minutes. Track separation is set for 120 minutes and I have lots of tracks loaded.)

I don't know how many times it happens that I'm missing. Haven't researched it that carefully.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC on July 19, 2014, 01:17:26 AM
Something like that is why I stated the thread, because the separation was completely working.  Any song that I had with a feature artist would be counted as a separate artist so I would get some artists back to back.
I think he tried to update that in 1.7.1 but I have not tried the new version yet.  Maybe give that a try.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marvin on July 19, 2014, 03:53:34 AM
I'll check out V1.7.1. This problem is not same group but one with featured artist, but is the same file repeating. Otherwise the latest is a great program here, been running 24/7 since shortly after it came out.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marvin on July 19, 2014, 01:28:13 PM
I think I've narrowed it down in my case to one of my rotations with less songs (still enough to maintain artist separation though) that had quite a few new song entries. I had the rotation set to play based on least number of times played. These newer songs show vastly less number of times aired than the older songs in the rotation. I've changed the rotation to pull songs based on random rather than least number of times aired. So far I find no repeats. Perhaps the number of times played was taking precedence over artist separation? I'll report back after a full day's history is available.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC on July 21, 2014, 08:30:39 PM
Perhaps the number of times played was taking precedence over artist separation? I'll report back after a full day's history is available.

@Marius is this the case? I am using 1.7.1 and I still don't see artist separation. I have a good amount of songs too.

Not only that, when I go to the song request page, it still shows other songs available from the artist that just played. The only song that's not available is the song that just played that featured an artist.

I went back to using my PHP script to update but the playlist is still repeating artists pretty close together. I have about 20 entries in my rotation including sweepers.

I have them all set to use Least times played, is that some how causing an issue? I should be able to do that without artist repeats. I have enough music.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marius on July 21, 2014, 09:15:24 PM
Did you enable it in RadioDJ options?
Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC on July 21, 2014, 10:45:51 PM
Did you enable it in RadioDJ options?

Ahhh, no sir I had not. I didn't know you added that option. I just figured it was included in the repeat rules.
Thanks, I'll play with it.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Marvin on July 23, 2014, 04:45:44 PM
Since changing the rotation rules to random rather than least times played I've not found further artist separation or early track repeating problems.   ;)
Title: Re: Artist separation (repeat rules) - Bug?
Post by: yatusabes on July 24, 2014, 04:12:57 PM
Very happy with this feature. I have been testing for a couple of days and works perfectly.

Thanks very much for your work.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: Brodephat on August 04, 2014, 04:59:59 AM
What I do is move the (featuring...) down to the title field after the song title. To me that made more sense since the featured artist is not the album artist.

So I change the mp3 metadata from

Drake feat Ti - Song Title

to

Drake - Song Title (feat. Ti)

Just makes more sense to me since Ti is not the actual artist for that album/song

Title: Re: Artist separation (repeat rules) - Bug?
Post by: HMC on August 04, 2014, 05:21:12 AM
What I do is move the (featuring...) down to the title field after the song title. To me that made more sense since the featured artist is not the album artist.

So I change the mp3 metadata from

Drake feat Ti - Song Title

to

Drake - Song Title (feat. Ti)

Just makes more sense to me since Ti is not the actual artist for that album/song

That might make since but many mp3 are tagged professionally with Artist feat someone - Song Title.  I have an app for my station and when it parses the metadata to display it, I only have to parse it one time because when I do my Last.FM api call to get the album art I already have the song title in a variable.  If I had the featured artist in the title I'd have to do more parsing initially. I prefer the title to show by itself on my app and radio.

Anyway, I believe the problem is fixed so doesn't really matter now.
Title: Re: Artist separation (repeat rules) - Bug?
Post by: shadowking46 on November 17, 2014, 04:24:21 PM
I have 8 different genres and many of the songs I have played are from different artists but doing the same song in their version of it. Is there going to be a new action, where as I can load all these diferent genres with the same song into the database with out it saying "already exists"
thank you