Normal
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 drived: Optical driveclient2:c: HD drived: 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.xmlIf 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%)GOALTER DATABASE [MovingPictures] SET COMPATIBILITY_LEVEL = 100GOIF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))beginEXEC [MovingPictures].[dbo].[sp_fulltext_database] @action = 'enable'endGOALTER DATABASE [MovingPictures] SET ANSI_NULL_DEFAULT OFFGOALTER DATABASE [MovingPictures] SET ANSI_NULLS OFFGOALTER DATABASE [MovingPictures] SET ANSI_PADDING OFFGOALTER DATABASE [MovingPictures] SET ANSI_WARNINGS OFFGOALTER DATABASE [MovingPictures] SET ARITHABORT OFFGOALTER DATABASE [MovingPictures] SET AUTO_CLOSE OFFGOALTER DATABASE [MovingPictures] SET AUTO_CREATE_STATISTICS ONGOALTER DATABASE [MovingPictures] SET AUTO_SHRINK OFFGOALTER DATABASE [MovingPictures] SET AUTO_UPDATE_STATISTICS ONGOALTER DATABASE [MovingPictures] SET CURSOR_CLOSE_ON_COMMIT OFFGOALTER DATABASE [MovingPictures] SET CURSOR_DEFAULT GLOBALGOALTER DATABASE [MovingPictures] SET CONCAT_NULL_YIELDS_NULL OFFGOALTER DATABASE [MovingPictures] SET NUMERIC_ROUNDABORT OFFGOALTER DATABASE [MovingPictures] SET QUOTED_IDENTIFIER OFFGOALTER DATABASE [MovingPictures] SET RECURSIVE_TRIGGERS OFFGOALTER DATABASE [MovingPictures] SET DISABLE_BROKERGOALTER DATABASE [MovingPictures] SET AUTO_UPDATE_STATISTICS_ASYNC OFFGOALTER DATABASE [MovingPictures] SET DATE_CORRELATION_OPTIMIZATION OFFGOALTER DATABASE [MovingPictures] SET TRUSTWORTHY OFFGOALTER DATABASE [MovingPictures] SET ALLOW_SNAPSHOT_ISOLATION OFFGOALTER DATABASE [MovingPictures] SET PARAMETERIZATION SIMPLEGOALTER DATABASE [MovingPictures] SET READ_COMMITTED_SNAPSHOT OFFGOALTER DATABASE [MovingPictures] SET HONOR_BROKER_PRIORITY OFFGOALTER DATABASE [MovingPictures] SET READ_WRITEGOALTER DATABASE [MovingPictures] SET RECOVERY SIMPLEGOALTER DATABASE [MovingPictures] SET MULTI_USERGOALTER DATABASE [MovingPictures] SET PAGE_VERIFY CHECKSUM GOALTER DATABASE [MovingPictures] SET DB_CHAINING OFFGO[/code]When u run mov pics plugin, take a look in :C:\ProgramData\Team MediaPortal\MediaPortal\log\movingpictures.logIt should read like this:22-Jan-2010 21:42:52 Info [ DatabaseManager]: SQL express initializedor22-Jan-2010 21:42:52 Info [ DatabaseManager]: SQLite initializednote: the patch also consists of the subtitles patch I did here -https://forum.team-mediaportal.com/mediaportal-plugins-47/generic-subtitles-retriever-library-movpic-tvseries-etc-75614/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
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:
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%)
ALTER DATABASE [MovingPictures] SET COMPATIBILITY_LEVEL = 100
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [MovingPictures].[dbo].[sp_fulltext_database] @action = 'enable'
end
ALTER DATABASE [MovingPictures] SET ANSI_NULL_DEFAULT OFF
ALTER DATABASE [MovingPictures] SET ANSI_NULLS OFF
ALTER DATABASE [MovingPictures] SET ANSI_PADDING OFF
ALTER DATABASE [MovingPictures] SET ANSI_WARNINGS OFF
ALTER DATABASE [MovingPictures] SET ARITHABORT OFF
ALTER DATABASE [MovingPictures] SET AUTO_CLOSE OFF
ALTER DATABASE [MovingPictures] SET AUTO_CREATE_STATISTICS ON
ALTER DATABASE [MovingPictures] SET AUTO_SHRINK OFF
ALTER DATABASE [MovingPictures] SET AUTO_UPDATE_STATISTICS ON
ALTER DATABASE [MovingPictures] SET CURSOR_CLOSE_ON_COMMIT OFF
ALTER DATABASE [MovingPictures] SET CURSOR_DEFAULT GLOBAL
ALTER DATABASE [MovingPictures] SET CONCAT_NULL_YIELDS_NULL OFF
ALTER DATABASE [MovingPictures] SET NUMERIC_ROUNDABORT OFF
ALTER DATABASE [MovingPictures] SET QUOTED_IDENTIFIER OFF
ALTER DATABASE [MovingPictures] SET RECURSIVE_TRIGGERS OFF
ALTER DATABASE [MovingPictures] SET DISABLE_BROKER
ALTER DATABASE [MovingPictures] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
ALTER DATABASE [MovingPictures] SET DATE_CORRELATION_OPTIMIZATION OFF
ALTER DATABASE [MovingPictures] SET TRUSTWORTHY OFF
ALTER DATABASE [MovingPictures] SET ALLOW_SNAPSHOT_ISOLATION OFF
ALTER DATABASE [MovingPictures] SET PARAMETERIZATION SIMPLE
ALTER DATABASE [MovingPictures] SET READ_COMMITTED_SNAPSHOT OFF
ALTER DATABASE [MovingPictures] SET HONOR_BROKER_PRIORITY OFF
ALTER DATABASE [MovingPictures] SET READ_WRITE
ALTER DATABASE [MovingPictures] SET RECOVERY SIMPLE
ALTER DATABASE [MovingPictures] SET MULTI_USER
ALTER DATABASE [MovingPictures] SET PAGE_VERIFY CHECKSUM
ALTER DATABASE [MovingPictures] SET DB_CHAINING OFF
[/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 -
https://forum.team-mediaportal.com/mediaportal-plugins-47/generic-subtitles-retriever-library-movpic-tvseries-etc-75614/
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