User edited fields not working as expected

Discussion in 'My TVSeries' started by JimCatMP, April 21, 2015.

  1. JimCatMP
    • Team MediaPortal

    JimCatMP Documentation Group

    Joined:
    April 1, 2010
    Messages:
    647
    Likes Received:
    153
    Gender:
    Male
    Location:
    Leeds
    Ratings:
    +282 / 1
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    Hi.

    Latest version differs from previous version in that Genre stated on Config is the delivered Genre from online lookup, previously it was the Genre__USEREDIT_String value.



    System: Genre String - '|Drama|Horror|Science-Fiction|'
    User: Genre__USEREDIT__ String - 'Scary'

    Net result for me is that I can no longer [without dipping into SQLITE] update the Genre to match my preferences.

    In operation, the Genre__USEREDIT_String is still used in live service, but for any new series, as is, I'm locked out of changing Genre without respiring to shell and sqlite3:(

    I cannot see any good reason for this, so assume it's not 'deliberate' change in function but simple side effect of other updates applied.

    For most people, probably not an issue, but any chance of having either old behaviour reinstated or ability to update USEREDIT strings [there are a number of them] in Config in later release [which ever is easier.

    Nothing will stop me using MPTVSeries however, it's still rocks by any measure(n)

    Cheers - JCMP
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. barneh
    • Premium Supporter

    barneh MP Donator

    Joined:
    February 4, 2010
    Messages:
    242
    Likes Received:
    27
    Location:
    Malmö
    Ratings:
    +53 / 0
    Home Country:
    Sweden Sweden
    Show System Specs
    If I understand you right, when you update the Genre value from '|Horror|' to 'Scary' you would like the field 'Genre' in the database to be updated, and not the 'Genre__USEREDIT__'?
     
  4. ltfearme
    • Premium Supporter

    ltfearme Community Plugin Dev

    Joined:
    June 10, 2007
    Messages:
    6,457
    Likes Received:
    4,241
    Gender:
    Male
    Occupation:
    Software Test Engineer
    Location:
    Sydney
    Ratings:
    +5,385 / 0
    Home Country:
    Australia Australia
    I don't think so, it's never been like that. If you edit a field it created a USEREDIT field, maybe something is broken with that e.g. it's not being read and displayed to the user.
     
  5. ltfearme
    • Premium Supporter

    ltfearme Community Plugin Dev

    Joined:
    June 10, 2007
    Messages:
    6,457
    Likes Received:
    4,241
    Gender:
    Male
    Occupation:
    Software Test Engineer
    Location:
    Sydney
    Ratings:
    +5,385 / 0
    Home Country:
    Australia Australia
    I did a quick test and confirm something is broken, I edited a field e.g. |Horror| -> |Horror|Test| and after closing the config and re-opening it was not being read back in.

    It does look like its writing to the database as expected.

    I reverted to the last release and it worked as expected, so its a regression with latest changes.
     
  6. ltfearme
    • Premium Supporter

    ltfearme Community Plugin Dev

    Joined:
    June 10, 2007
    Messages:
    6,457
    Likes Received:
    4,241
    Gender:
    Male
    Occupation:
    Software Test Engineer
    Location:
    Sydney
    Ratings:
    +5,385 / 0
    Home Country:
    Australia Australia
    I did a further test and confirmed its being read and displayed to user in the MediaPortal GUI, its just not displaying user edits in the configuration after close and re-open.
     
    • Thank You! Thank You! x 1
    • Informative Informative x 1
  7. JimCatMP
    • Team MediaPortal

    JimCatMP Documentation Group

    Joined:
    April 1, 2010
    Messages:
    647
    Likes Received:
    153
    Gender:
    Male
    Location:
    Leeds
    Ratings:
    +282 / 1
    Home Country:
    United Kingdom United Kingdom
    Show System Specs

    Ah - I didn't check that the edit made it to the DB itself [which given the trouble I went to in digging into the DB with SQLITE, exporting data & schema then comparing them, seems a little silly on my part, only doing 1/2 the job :(

    So, it's the display element of the Config GU, core data management is 100% solid and updating of USEREDIT fields are unchanged - means I can still manage genres, just need to remember I've done it:cool:

    As always, appreciate the help & info chaps:)

    TTFN - JCMP
     
    • Thank You! Thank You! x 1
  8. ltfearme
    • Premium Supporter

    ltfearme Community Plugin Dev

    Joined:
    June 10, 2007
    Messages:
    6,457
    Likes Received:
    4,241
    Gender:
    Male
    Occupation:
    Software Test Engineer
    Location:
    Sydney
    Ratings:
    +5,385 / 0
    Home Country:
    Australia Australia
    Thanks for reporting, there is a bug obviously with the configuration tool which we have to look at.

    @barneh, do you have time to take a look?
     
  9. barneh
    • Premium Supporter

    barneh MP Donator

    Joined:
    February 4, 2010
    Messages:
    242
    Likes Received:
    27
    Location:
    Malmö
    Ratings:
    +53 / 0
    Home Country:
    Sweden Sweden
    Show System Specs
    I can... but I need to understand the problem :)

    If I edit the Genre from "|Horror|" to "|Scary|" it makes a a new or change to the Genre__USEREDIT__ field in the DB.
    Is the problem that this __USEREDIT__ field is not shown in Configuration GUI?
     
  10. ltfearme
    • Premium Supporter

    ltfearme Community Plugin Dev

    Joined:
    June 10, 2007
    Messages:
    6,457
    Likes Received:
    4,241
    Gender:
    Male
    Occupation:
    Software Test Engineer
    Location:
    Sydney
    Ratings:
    +5,385 / 0
    Home Country:
    Australia Australia
    It makes a new database field called Genre_USEREDIT__ and inserts the genre in there. You can see in the configuration the row turns blue in colour. Now if you restart the config, you can see it shows you Genre instead of Genre_USEREDIT__.

    I can see how it got broken:

    Code (Text):
    1.  
    2. private void AddPropertyBindingSource(string FieldPrettyName, string FieldName, string FieldValue, bool CanModify, DataGridViewContentAlignment TextAlign)
    3.   {
    4.   int id = -1;
    5.   bool userEdited = false;
    6.   // are we a user_edited item? if so replace the orig entry
    7.   if (FieldName.EndsWith(DBTable.cUserEditPostFix))
    8.   {
    9.   // except if the content is empty, then we just dont display it
    10.   if (string.IsNullOrEmpty(FieldValue)) return;
    11.   string origFieldName = FieldName.Replace(DBTable.cUserEditPostFix, "");
    12.   for (int i = 0; i < dataGridView1.Rows.Count; i++)
    13.   {
    14.   if (dataGridView1.Rows[i].Cells[1].Tag as string == origFieldName)
    15.   {
    16.   id = i;
    17.   userEdited = true;
    18.   break;
    19.   }
    20.  
    21.   }
    22.   }
    23.  
    24.   if (id < 0)
    25.   {
    26.   DataGridViewRow dataGridDetailRow = new DataGridViewRow();
    27.   DataGridViewTextBoxCell cFieldName;
    28.  
    29.   if ((FieldName == DBOnlineSeries.cLanguage) && (DBOption.GetOptions(DBOption.cOverrideLanguage)))
    30.   {
    31.   dataGridDetailRow = new DataGridViewRow();
    32.   cFieldName = new DataGridViewTextBoxCell();
    33.   DataGridViewComboBoxCell cbCell = new DataGridViewComboBoxCell();
    34.  
    35.   // First Column (Name)
    36.   cFieldName.Value = FieldPrettyName;
    37.   cFieldName.Style.BackColor = System.Drawing.SystemColors.Control;
    38.   dataGridDetailRow.Cells.Add(cFieldName);
    39.   cFieldName.ReadOnly = true;
    40.  
    41.   // Second Column (Value)
    42.   if (onlineLanguages.Count == 0)
    43.   {
    44.   onlineLanguages.AddRange(new GetLanguages().languages);
    45.   }
    46.  
    47.   foreach (Language lang in onlineLanguages)
    48.   {
    49.   cbCell.Items.Add(lang.language);
    50.   }
    51.  
    52.   Language selectedLang = onlineLanguages.Find(x => x.abbreviation.Contains(FieldValue));
    53.   for (int i = 0; i < cbCell.Items.Count; i++)
    54.   {
    55.   string s = cbCell.Items[i].ToString();
    56.   if (cbCell.Items[i].ToString() == selectedLang.language)
    57.   {
    58.   cbCell.Value = cbCell.Items[i];
    59.   }
    60.   }
    61.  
    62.   cbCell.Tag = FieldName;
    63.  
    64.   dataGridDetailRow.Cells.Add(cbCell);
    65.   cbCell.ReadOnly = false;
    66.  
    67.   // Add the row to the DataGridView
    68.   dataGridView1.Rows.Add(dataGridDetailRow);
    69.   }
    70.   else
    71.   {
    72.   cFieldName = new DataGridViewTextBoxCell();
    73.   DataGridViewTextBoxCell cFieldValue = new DataGridViewTextBoxCell();
    74.  
    75.   if (FieldName == DBEpisode.cAudioLanguage)
    76.   FieldPrettyName = GetAudioLanguageDisplayName(FieldValue);
    77.  
    78.   // First Column (Name)
    79.   cFieldName.Value = FieldPrettyName;
    80.   cFieldName.Style.BackColor = System.Drawing.SystemColors.Control;
    81.   dataGridDetailRow.Cells.Add(cFieldName);
    82.   cFieldName.ReadOnly = true;
    83.  
    84.   cFieldValue.Value = FieldValue;
    85.   cFieldValue.Tag = FieldName;
    86.  
    87.   dataGridDetailRow.Cells.Add(cFieldValue);
    88.  
    89.   if (!CanModify)
    90.   {
    91.   cFieldValue.ReadOnly = true;
    92.   cFieldValue.Style.BackColor = System.Drawing.SystemColors.Control;
    93.   }
    94.  
    95.   if (userEdited)
    96.   {
    97.   cFieldValue.Style.ForeColor = System.Drawing.SystemColors.HotTrack;
    98.  
    99.   }
    100.  
    101.   cFieldValue.Style.Alignment = TextAlign;
    102.  
    103.   // Add the rows to the DataGridView
    104.   dataGridView1.Rows.Add(dataGridDetailRow);
    105.   }
    106.   }
    107.   }
    108.  
    When there is a user edit, the id is > 0, therefore it gets to the condition "if (id < 0)" and then exits the method.
     
  11. barneh
    • Premium Supporter

    barneh MP Donator

    Joined:
    February 4, 2010
    Messages:
    242
    Likes Received:
    27
    Location:
    Malmö
    Ratings:
    +53 / 0
    Home Country:
    Sweden Sweden
    Show System Specs
    Sorry but I still don't understand what the problem is?

    I have looked at the code before I added Language, and nothing is broken as I can see...
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!