home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
MediaPortal Alpha's, RC's and Git-Builds
1.24-1.29 Pre Release
5061: Music Database doesn't show all Data...
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="ajs" data-source="post: 1281840" data-attributes="member: 68833"><p>I do not understand the logic of this procedure, why do we always ask the number of columns? <a href="https://github.com/MediaPortal/MediaPortal-1/blob/master/mediaportal/Databases/SQLiteClient.cs#L475" target="_blank">MediaPortal/MediaPortal-1</a></p><p>Maybe it would be easier and more logical to move this to the line <a href="https://github.com/MediaPortal/MediaPortal-1/blob/master/mediaportal/Databases/SQLiteClient.cs#L524" target="_blank">MediaPortal/MediaPortal-1</a></p><p>And then the source code will be like this:</p><p>We delete this lines - <a href="https://github.com/MediaPortal/MediaPortal-1/blob/master/mediaportal/Databases/SQLiteClient.cs#L475" target="_blank">MediaPortal/MediaPortal-1</a> <a href="https://github.com/MediaPortal/MediaPortal-1/blob/master/mediaportal/Databases/SQLiteClient.cs#L512" target="_blank">MediaPortal/MediaPortal-1</a></p><p>And <a href="https://github.com/MediaPortal/MediaPortal-1/blob/master/mediaportal/Databases/SQLiteClient.cs#L521-L536" target="_blank">MediaPortal/MediaPortal-1</a> change to:</p><p>[CODE=csharp] // We have some data; lets read it</p><p> if (set1.ColumnNames.Count == 0)</p><p> {</p><p> pN = sqlite3_column_count(pVm); </p><p> if (pVm == IntPtr.Zero)</p><p> {</p><p> ThrowError("sqlite3_column_count:pvm=null", query, res);</p><p> }</p><p></p><p> for (int i = 0; i < pN; i++)</p><p> {</p><p> string colName;</p><p> IntPtr pName = sqlite3_column_name16(pVm, i);</p><p> if (pName == IntPtr.Zero)</p><p> {</p><p> ThrowError(String.Format("SqlClient:sqlite3_column_name16() returned null {0}/{1}", i, pN), query, res);</p><p> }</p><p> colName = Marshal.PtrToStringUni(pName);</p><p> set1.columnNames.Add(colName);</p><p> set1.ColumnIndices[colName] = i;</p><p> }</p><p> }[/CODE]</p></blockquote><p></p>
[QUOTE="ajs, post: 1281840, member: 68833"] I do not understand the logic of this procedure, why do we always ask the number of columns? [URL="https://github.com/MediaPortal/MediaPortal-1/blob/master/mediaportal/Databases/SQLiteClient.cs#L475"]MediaPortal/MediaPortal-1[/URL] Maybe it would be easier and more logical to move this to the line [URL="https://github.com/MediaPortal/MediaPortal-1/blob/master/mediaportal/Databases/SQLiteClient.cs#L524"]MediaPortal/MediaPortal-1[/URL] And then the source code will be like this: We delete this lines - [URL="https://github.com/MediaPortal/MediaPortal-1/blob/master/mediaportal/Databases/SQLiteClient.cs#L475"]MediaPortal/MediaPortal-1[/URL] [URL="https://github.com/MediaPortal/MediaPortal-1/blob/master/mediaportal/Databases/SQLiteClient.cs#L512"]MediaPortal/MediaPortal-1[/URL] And [URL="https://github.com/MediaPortal/MediaPortal-1/blob/master/mediaportal/Databases/SQLiteClient.cs#L521-L536"]MediaPortal/MediaPortal-1[/URL] change to: [CODE=csharp] // 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; } }[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
MediaPortal Alpha's, RC's and Git-Builds
1.24-1.29 Pre Release
5061: Music Database doesn't show all Data...
Contact us
RSS
Top
Bottom