5061: Music Database doesn't show all Data... (1 Viewer)

ajs

Development Group
  • Team MediaPortal
  • February 29, 2008
    15,492
    10,369
    Kyiv
    Home Country
    Ukraine Ukraine
    I do not understand the logic of this procedure, why do we always ask the number of columns? MediaPortal/MediaPortal-1
    Maybe it would be easier and more logical to move this to the line MediaPortal/MediaPortal-1
    And then the source code will be like this:
    We delete this lines - MediaPortal/MediaPortal-1 MediaPortal/MediaPortal-1
    And MediaPortal/MediaPortal-1 change to:
    C#:
            // We have some data; lets read it
            if (set1.ColumnNames.Count == 0)
            {
              pN = sqlite3_column_count(pVm); 
              if (pVm == IntPtr.Zero)
              {
                ThrowError("sqlite3_column_count:pvm=null", query, res);
              }
    
              for (int i = 0; i < pN; i++)
              {
                string colName;
                IntPtr pName = sqlite3_column_name16(pVm, i);
                if (pName == IntPtr.Zero)
                {
                  ThrowError(String.Format("SqlClient:sqlite3_column_name16() returned null {0}/{1}", i, pN), query, res);
                }
                colName = Marshal.PtrToStringUni(pName);
                set1.columnNames.Add(colName);
                set1.ColumnIndices[colName] = i;
              }
            }
     

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    4,566
    2,938
    Nuenen
    Home Country
    Netherlands Netherlands
    @doskabouter if we change this: MediaPortal/MediaPortal-1
    from:
    C#:
    internal void ReadpVm(string query, SQLiteResultSet set1, ref IntPtr pVm)
    to:
    C#:
    internal SQLiteResultSet ReadpVm(string query, ref IntPtr pVm)
    Could this help?
    nah, that wouldnt make much in perfomance, at most a bit more readable

    same holds for your other changes.
    Must say, this isn't the clearest bit of code, had to read it a couple of times to fully grasp what's going on.
    So if not for performance, this is a good candidate for refactoring
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,492
    10,369
    Kyiv
    Home Country
    Ukraine Ukraine
    Its not my Code :) but in many places in the Media Portal I do not understand what is happening and why.

    -- Tapatalk | WBR, ajs
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,492
    10,369
    Kyiv
    Home Country
    Ukraine Ukraine
    I didn’t look, so my changes didn’t help. In Test 4, the sampling time is increased to a minute, but this is a bad option, you need to find why your time increases from 0 seconds to more than a minute.

    -- Tapatalk | WBR, ajs
     

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    4,566
    2,938
    Nuenen
    Home Country
    Netherlands Netherlands
    Did you have some performance stats/resource monitor (showing some unusual spikes when you didn't get the full list) open while you got those errors?
    Beginning to get quite curious...
     

    Users who are viewing this thread

    Top Bottom