Open BBGuy opened 10 years ago
Option 2 is the one to go for!
Step 1 - added the right_type to the $rights['contributions'] array
Step 2 - updated the calculation to work out the percentage within the right type
I have added a condition to the recursive part of step 1 a condition that only adds child contributions of the correct type. This is especially important as we have a sample track for each of the rights types. The result is that calculations now fully respect the right type. although we will need to implement the other steps to allow weighting between right types.
Looking at the functionality again looks like we can get away with only making a change to step 3 without updating 4 or needing 5.
As we can multiply each percentage by the relevant $rt_split element, the only issue is that if a three right types are provided and only two are used the end result will not add to 100%, this is mitigated by the fact that the graph is a proportion representation.
We may also be able to make the ux for entering the data show only the relevant right types or do a proportional update of $rt_split that uses only the found right types.
to do after resolving step 3:
Got a couple of test assets will use those to test the number but its looking good real good :)
An asset with a Single composition, and two performance: with the following rights splt (50/50):
$rt_split = array (
'Composition' => 50,
'Performance' => 50,
'Recording' => 0,
);
as can be observed the single composer gets 50% while the two performers get 25% each
We now change the split to 75/25:
$rt_split = array (
'Composition' => 75,
'Performance' => 25,
'Recording' => 0,
);
same track now gives the composer 75% while the performers get half of the 25% (the chart uses rounding and I will add the underlining data next week)
{to do}
I have pushed the following changes:
Added validation for missing right types, those are set to zero to make sure calculations work without errors (see image below)
@dahacouk I have almost finished the configurable right splits, what I need from you is a list of names and splits something Like: UK Radio: Composition=40,Performance=50,Recording=10 US Radio: Composition=45,Performance=50,Recording=5 names can be what ever you want.
Those will be available in a dropdown but I have done it in such a way that you will be able to change the url to get a specific split not in the options so it will look like http://hub2.kendra.org/content/stairway-heaven?Composition=50&Performance=50
OK. I'm going out to the community to get feedback. We also need to know what other possible "right types" we may need to represent in the system...
This is now live with test data see http://kendra_hub_v2.dev.local/content/stairway-heaven Would be nice if the selected option was remembered after submitting the form.
task "bottom of chart key sometimes gets cut off at bottom of screen see http://hub2.kendra.org/content/song-55" moved to its own issue #50
Initial requirements
The current 50/50 split is not accurate as in reality the function handles all contributions as equal. This can cause confusion especially when we have more then two right types. We have two options: 1) remove the 50/50 graph - easy 2) fully implement the Rights split - not an easy task but needed if we are to try and show realistic data. This will allow us to show splits by country.
Changes to Rights split algorithm
The current algorithm process uses a four stage process the below are the changes needed to those steps plus one additional step. What those changes do is use the four steps two work out the percentage within each of the right types and the extra steps to work the overall split using a newly supplied split. The changes are as follows:
Array( [right type] => percent 0-100 }
was not needed:
To do
Testing
We didnt get a chance to do much testing before going live but indications are that it is working corectly