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
MediaPortal 1 Plugins
Popular Plugins
Moving Pictures
patch - centralized DB fixes.
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="gibman" data-source="post: 563193" data-attributes="member: 25430"><p>Hi!</p><p></p><p>Several issues with moving pictures have been bothering me for too long now.</p><p>Primarily because I run a centralized sqllite database over a common network share.</p><p></p><p>A common practice for those who have more than one htpc rig in their setup and at the same time want to be able to share the database amongst these clients.</p><p></p><p>No idea how popular this setup is ?</p><p></p><p>But here goes.</p><p></p><p>My fixes include:</p><p></p><p>1) The database connection was not closed when going into standby/hibernation mode. This would cause all kinds of SQL lite exceptions once the HTPC was resumed again. This would often cause the db image (file) to become malformed. The only solution in these situations would be to rebuild the database once again. Tedious job.</p><p></p><p>My fix for this includes having the movpic plugin now properly react to the onsuspend and onresume events.</p><p>On "OnSuspend" it will close the DB connection. On resume it will reestablish connection.</p><p></p><p>2) When resuming the client, no new movies would be added to the GUI. I have to restart MP in order to have the GUI refreshed.</p><p></p><p>The solution for this was to have the worker threads abort when going into standby/hibernation mode and restart when resuming.</p><p>Likewise it will also detach any of the listening events to the database manager and reestablish these on resume.</p><p>Now I am able to see newly added movies on a resumed movpics client.</p><p></p><p>3) Optical and Removable drives are added to the "import_path" table as internallymanaged=1.</p><p></p><p>consider this problem (both clients share the same DB).</p><p></p><p>client1:</p><p>c: HD drive</p><p>d: Optical drive</p><p></p><p>client2:</p><p>c: HD drive</p><p>d: network drive, not containing movies, but other irrelevant stuff.</p><p></p><p>client1 starts movpics.</p><p>"D:\" is added with internallymanaged=1.</p><p>client1 exits.</p><p></p><p>client2 starts movpics.</p><p>now movpics detects "D:\" as an internally managed drive and starts to scan/analyze it.</p><p>The problem is that drive D on client2 is a network drive.</p><p>So movpics start to crunch the networked HD for hours (depending on size etc), and adding irrelevant stuff to the DB.</p><p></p><p>The solution to this problem is to always test an internally managed drive type before scanning.</p><p>The drivetype must NOT be a fixed or network type.</p><p>If so, the import path entries will be deleted.</p><p></p><p></p><p>No doubt that movpics would be performing better on a real SQL engine like "ms SQL express" or "mySQL".</p><p>Changing the SQL dataprovider would be the best option.</p><p></p><p>we can only wait <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p><p></p><p></p><p>Edit: wait's over <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p><p></p><p>Ok, patch ready for some testing.</p><p></p><p>It should work under both sqlite and ms sql express (ex. the same as tvserver uses).</p><p></p><p>It initially looks for :</p><p>C:\ProgramData\Team MediaPortal\MediaPortal\MovingPictures.xml</p><p>If it doesnt exists, it will create it.</p><p></p><p><?xml version="1.0" encoding="utf-8"?></p><p><profile></p><p> <section name="database"></p><p> <entry name="SQLexpressEnabled">yes</entry></p><p> <entry name="SQLexpressConnectString">Data Source=myserver\SQLEXPRESS;Initial Catalog=MovingPictures;User Id=sa; password=mypassword;Trusted_Connection=False;MultipleActiveResultSets=true</entry></p><p> </section></p><p></profile></p><p></p><p>if u wish to re-enable sqlite, then please use:</p><p>SQLexpressEnabled = no.</p><p></p><p>use the correct connect string here.</p><p></p><p>You currently have to create the DB yourself.</p><p>Use this script:</p><p></p><p>[code]</p><p>USE [master]</p><p>GO</p><p></p><p>/****** Object: Database [MovingPictures] Script Date: 01/22/2010 21:45:04 ******/</p><p>CREATE DATABASE [MovingPictures] ON PRIMARY </p><p>( NAME = N'MovingPictures', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\MovingPictures.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )</p><p> LOG ON </p><p>( NAME = N'MovingPictures_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\MovingPictures_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)</p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET COMPATIBILITY_LEVEL = 100</p><p>GO</p><p></p><p>IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))</p><p>begin</p><p>EXEC [MovingPictures].[dbo].[sp_fulltext_database] @action = 'enable'</p><p>end</p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET ANSI_NULL_DEFAULT OFF </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET ANSI_NULLS OFF </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET ANSI_PADDING OFF </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET ANSI_WARNINGS OFF </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET ARITHABORT OFF </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET AUTO_CLOSE OFF </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET AUTO_CREATE_STATISTICS ON </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET AUTO_SHRINK OFF </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET AUTO_UPDATE_STATISTICS ON </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET CURSOR_CLOSE_ON_COMMIT OFF </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET CURSOR_DEFAULT GLOBAL </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET CONCAT_NULL_YIELDS_NULL OFF </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET NUMERIC_ROUNDABORT OFF </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET QUOTED_IDENTIFIER OFF </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET RECURSIVE_TRIGGERS OFF </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET DISABLE_BROKER </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET AUTO_UPDATE_STATISTICS_ASYNC OFF </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET DATE_CORRELATION_OPTIMIZATION OFF </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET TRUSTWORTHY OFF </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET ALLOW_SNAPSHOT_ISOLATION OFF </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET PARAMETERIZATION SIMPLE </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET READ_COMMITTED_SNAPSHOT OFF </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET HONOR_BROKER_PRIORITY OFF </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET READ_WRITE </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET RECOVERY SIMPLE </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET MULTI_USER </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET PAGE_VERIFY CHECKSUM </p><p>GO</p><p></p><p>ALTER DATABASE [MovingPictures] SET DB_CHAINING OFF </p><p>GO</p><p></p><p></p><p>[/code]</p><p></p><p></p><p>When u run mov pics plugin, take a look in :</p><p>C:\ProgramData\Team MediaPortal\MediaPortal\log\movingpictures.log</p><p></p><p>It should read like this:</p><p>22-Jan-2010 21:42:52 Info [ DatabaseManager]: SQL express initialized </p><p></p><p>or</p><p></p><p>22-Jan-2010 21:42:52 Info [ DatabaseManager]: SQLite initialized </p><p></p><p>note: the patch also consists of the subtitles patch I did here - </p><p><a href="https://forum.team-mediaportal.com/mediaportal-plugins-47/generic-subtitles-retriever-library-movpic-tvseries-etc-75614/" target="_blank">https://forum.team-mediaportal.com/mediaportal-plugins-47/generic-subtitles-retriever-library-movpic-tvseries-etc-75614/</a></p><p>Some external DLLs etc. are needed.</p><p></p><p>Or you can locally remove the subtitles part of the patch.</p><p>so in essence it's a subtitles retriever + sql express patch, all combined.</p><p></p><p>/gibman</p></blockquote><p></p>
[QUOTE="gibman, post: 563193, member: 25430"] Hi! Several issues with moving pictures have been bothering me for too long now. Primarily because I run a centralized sqllite database over a common network share. A common practice for those who have more than one htpc rig in their setup and at the same time want to be able to share the database amongst these clients. No idea how popular this setup is ? But here goes. My fixes include: 1) The database connection was not closed when going into standby/hibernation mode. This would cause all kinds of SQL lite exceptions once the HTPC was resumed again. This would often cause the db image (file) to become malformed. The only solution in these situations would be to rebuild the database once again. Tedious job. My fix for this includes having the movpic plugin now properly react to the onsuspend and onresume events. On "OnSuspend" it will close the DB connection. On resume it will reestablish connection. 2) When resuming the client, no new movies would be added to the GUI. I have to restart MP in order to have the GUI refreshed. The solution for this was to have the worker threads abort when going into standby/hibernation mode and restart when resuming. Likewise it will also detach any of the listening events to the database manager and reestablish these on resume. Now I am able to see newly added movies on a resumed movpics client. 3) Optical and Removable drives are added to the "import_path" table as internallymanaged=1. consider this problem (both clients share the same DB). client1: c: HD drive d: Optical drive client2: c: HD drive d: network drive, not containing movies, but other irrelevant stuff. client1 starts movpics. "D:\" is added with internallymanaged=1. client1 exits. client2 starts movpics. now movpics detects "D:\" as an internally managed drive and starts to scan/analyze it. The problem is that drive D on client2 is a network drive. So movpics start to crunch the networked HD for hours (depending on size etc), and adding irrelevant stuff to the DB. The solution to this problem is to always test an internally managed drive type before scanning. The drivetype must NOT be a fixed or network type. If so, the import path entries will be deleted. No doubt that movpics would be performing better on a real SQL engine like "ms SQL express" or "mySQL". Changing the SQL dataprovider would be the best option. we can only wait :) Edit: wait's over :) Ok, patch ready for some testing. It should work under both sqlite and ms sql express (ex. the same as tvserver uses). It initially looks for : C:\ProgramData\Team MediaPortal\MediaPortal\MovingPictures.xml If it doesnt exists, it will create it. <?xml version="1.0" encoding="utf-8"?> <profile> <section name="database"> <entry name="SQLexpressEnabled">yes</entry> <entry name="SQLexpressConnectString">Data Source=myserver\SQLEXPRESS;Initial Catalog=MovingPictures;User Id=sa; password=mypassword;Trusted_Connection=False;MultipleActiveResultSets=true</entry> </section> </profile> if u wish to re-enable sqlite, then please use: SQLexpressEnabled = no. use the correct connect string here. You currently have to create the DB yourself. Use this script: [code] USE [master] GO /****** Object: Database [MovingPictures] Script Date: 01/22/2010 21:45:04 ******/ CREATE DATABASE [MovingPictures] ON PRIMARY ( NAME = N'MovingPictures', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\MovingPictures.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) LOG ON ( NAME = N'MovingPictures_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\MovingPictures_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%) GO ALTER DATABASE [MovingPictures] SET COMPATIBILITY_LEVEL = 100 GO IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled')) begin EXEC [MovingPictures].[dbo].[sp_fulltext_database] @action = 'enable' end GO ALTER DATABASE [MovingPictures] SET ANSI_NULL_DEFAULT OFF GO ALTER DATABASE [MovingPictures] SET ANSI_NULLS OFF GO ALTER DATABASE [MovingPictures] SET ANSI_PADDING OFF GO ALTER DATABASE [MovingPictures] SET ANSI_WARNINGS OFF GO ALTER DATABASE [MovingPictures] SET ARITHABORT OFF GO ALTER DATABASE [MovingPictures] SET AUTO_CLOSE OFF GO ALTER DATABASE [MovingPictures] SET AUTO_CREATE_STATISTICS ON GO ALTER DATABASE [MovingPictures] SET AUTO_SHRINK OFF GO ALTER DATABASE [MovingPictures] SET AUTO_UPDATE_STATISTICS ON GO ALTER DATABASE [MovingPictures] SET CURSOR_CLOSE_ON_COMMIT OFF GO ALTER DATABASE [MovingPictures] SET CURSOR_DEFAULT GLOBAL GO ALTER DATABASE [MovingPictures] SET CONCAT_NULL_YIELDS_NULL OFF GO ALTER DATABASE [MovingPictures] SET NUMERIC_ROUNDABORT OFF GO ALTER DATABASE [MovingPictures] SET QUOTED_IDENTIFIER OFF GO ALTER DATABASE [MovingPictures] SET RECURSIVE_TRIGGERS OFF GO ALTER DATABASE [MovingPictures] SET DISABLE_BROKER GO ALTER DATABASE [MovingPictures] SET AUTO_UPDATE_STATISTICS_ASYNC OFF GO ALTER DATABASE [MovingPictures] SET DATE_CORRELATION_OPTIMIZATION OFF GO ALTER DATABASE [MovingPictures] SET TRUSTWORTHY OFF GO ALTER DATABASE [MovingPictures] SET ALLOW_SNAPSHOT_ISOLATION OFF GO ALTER DATABASE [MovingPictures] SET PARAMETERIZATION SIMPLE GO ALTER DATABASE [MovingPictures] SET READ_COMMITTED_SNAPSHOT OFF GO ALTER DATABASE [MovingPictures] SET HONOR_BROKER_PRIORITY OFF GO ALTER DATABASE [MovingPictures] SET READ_WRITE GO ALTER DATABASE [MovingPictures] SET RECOVERY SIMPLE GO ALTER DATABASE [MovingPictures] SET MULTI_USER GO ALTER DATABASE [MovingPictures] SET PAGE_VERIFY CHECKSUM GO ALTER DATABASE [MovingPictures] SET DB_CHAINING OFF GO [/code] When u run mov pics plugin, take a look in : C:\ProgramData\Team MediaPortal\MediaPortal\log\movingpictures.log It should read like this: 22-Jan-2010 21:42:52 Info [ DatabaseManager]: SQL express initialized or 22-Jan-2010 21:42:52 Info [ DatabaseManager]: SQLite initialized note: the patch also consists of the subtitles patch I did here - [url]https://forum.team-mediaportal.com/mediaportal-plugins-47/generic-subtitles-retriever-library-movpic-tvseries-etc-75614/[/url] Some external DLLs etc. are needed. Or you can locally remove the subtitles part of the patch. so in essence it's a subtitles retriever + sql express patch, all combined. /gibman [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
Moving Pictures
patch - centralized DB fixes.
Contact us
RSS
Top
Bottom