kendraio / kendra_hub

Kendra Hub
https://www.kendra.io/kendra-hub
GNU General Public License v2.0
4 stars 1 forks source link

Aggregated rights report - correct implementation of Rights split #48

Open BBGuy opened 10 years ago

BBGuy commented 10 years ago

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:

was not needed:

  1. Total each of the artists aggregated rights percentages.
  2. Calculate the overall percentage according to a supplied split.

    To do

    • [x] Validation for $rt_split and if no all rights types are used proportionally adjust those that do Split the "Rights split" graph into two
    • [x] 1) "Requested rights split"
    • [x] 2) "Actual rights split"
    • [x] Have a table showing the right splits with actual numbers
    • [x] Add a Legal entities split Graph and Table for each right type as well as the combined one
    • [x] Basic UX for setting $rt_split - using a hardcoded drop down list of options
    • [ ] Would be nice if the selected option for $rt_split was remembered after submitting the form.

      Testing

We didnt get a chance to do much testing before going live but indications are that it is working corectly

dahacouk commented 10 years ago

Option 2 is the one to go for!

BBGuy commented 10 years ago

Step 1 - added the right_type to the $rights['contributions'] array

BBGuy commented 10 years ago

Step 2 - updated the calculation to work out the percentage within the right type

BBGuy commented 10 years ago

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.

BBGuy commented 10 years ago

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:

BBGuy commented 10 years ago

Got a couple of test assets will use those to test the number but its looking good real good :)

BBGuy commented 9 years ago

Local Dev test

Test one a simple test

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,
    );

01 track a split 50 50 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,
    );

01 track a split 75 25 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)

Test two - embedded sample

{to do}

BBGuy commented 9 years ago

I have pushed the following changes:

BBGuy commented 9 years ago

Added validation for missing right types, those are set to zero to make sure calculations work without errors (see image below) rights_split_validation

BBGuy commented 9 years ago

@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

dahacouk commented 9 years ago

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... screenshot 2014-10-22 13 08 14

BBGuy commented 9 years ago

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.

BBGuy commented 9 years ago

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