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
Plugin: RARFileSource (A rar filter)
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="1stdead" data-source="post: 984341" data-attributes="member: 66469"><p>Ok, trying once again.. You won't get this to work with 1.3 as there might have been some changes in MP - at least that was my findings when testing it. So if any developer could look through this code, we might get it to work again.</p><p> </p><p> </p><p>I updated it to work properly and added support for mp4, BUT there's currently a bug in the code adding/removing the rar extensions from mediaportal.xml.. I couldn't locate that. Perhaps someone could help?</p><p> </p><p>[code]//css_reference "MpeCore.dll";</p><p>//css_reference "Utils.dll";</p><p> </p><p>using MpeCore.Classes;</p><p>using MpeCore;</p><p>using System.Diagnostics;</p><p>using System;</p><p>using MediaPortal.Profile;</p><p> </p><p> public class Script</p><p> {</p><p> public static void Main(PackageClass packageClass, ActionItem actionItem)</p><p> {</p><p> ProcessStartInfo psi = new ProcessStartInfo();</p><p> psi.WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.System);</p><p> psi.FileName = "cmd.exe";</p><p> psi.Arguments = "/c regsvr32 /s \"" + MpeInstaller.TransformInRealPath(@"%Base%\RARFileSource.ax") + "\""; psi.Verb = "runas";</p><p> psi.CreateNoWindow = true;</p><p> psi.WindowStyle = ProcessWindowStyle.Hidden;</p><p> psi.ErrorDialog = false;</p><p> try</p><p> {</p><p> Process p = System.Diagnostics.Process.Start(psi);</p><p> p.WaitForExit(10000);</p><p> addVideoExtension(".rar");</p><p> }</p><p> catch</p><p> {</p><p> </p><p> }</p><p> }</p><p> </p><p> // add the extension</p><p> static bool addVideoExtension(string extension)</p><p> {</p><p> using (MediaPortal.Profile.Settings xmlwriter = new MPSettings())</p><p> {</p><p> string currValue = xmlwriter.GetValue("movies", "extensions");</p><p> if(!currValue.ToLower().Contains(extension))</p><p> {</p><p> xmlwriter.SetValue("movies", "extensions", currValue + "," + extension);</p><p> MediaPortal.Profile.Settings.SaveCache();</p><p> return true;</p><p> }</p><p> }</p><p> return false;</p><p> }</p><p> }[/code]</p><p> </p><p>[code]//css_reference "Utils.dll";</p><p> </p><p>using MpeCore.Classes;</p><p>using MpeCore;</p><p>using System.Diagnostics;</p><p>using System;</p><p>using System.IO;</p><p>using MediaPortal.Profile;</p><p>using System.Windows.Forms;</p><p> </p><p> public class Script</p><p> {</p><p> public static void Main(PackageClass packageClass, UnInstallItem actionItem)</p><p> {</p><p> string rarfilter = MpeInstaller.TransformInRealPath(@"%Base%\RARFileSource.ax");</p><p> ProcessStartInfo psi = new ProcessStartInfo();</p><p> psi.WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.System);</p><p> psi.FileName = "cmd.exe";</p><p> psi.Arguments = "/c regsvr32 /s /u \"" + rarfilter + "\"";</p><p> psi.Verb = "runas";</p><p> psi.CreateNoWindow = true;</p><p> psi.WindowStyle = ProcessWindowStyle.Hidden;</p><p> psi.ErrorDialog = false;</p><p> try</p><p> {</p><p> Process p = System.Diagnostics.Process.Start(psi);</p><p> p.WaitForExit(10000);</p><p> if (File.Exists(rarfilter))</p><p> File.Delete(rarfilter );</p><p> removeVideoExtension(".rar");</p><p> }</p><p> catch</p><p> {</p><p> }</p><p> }</p><p> </p><p> // remove the extension</p><p> static bool removeVideoExtension(string extension)</p><p> {</p><p> using (MediaPortal.Profile.Settings xmlwriter = new MPSettings())</p><p> {</p><p> string currValue = xmlwriter.GetValue("movies", "extensions");</p><p> if(currValue.ToLower().Contains(extension))</p><p> {</p><p> if (MessageBox.Show("Would you like to remove the .rar Extension as a Video Extension?", "Remove Extension", MessageBoxButtons.YesNo)</p><p> == DialogResult.Yes)</p><p> {</p><p> xmlwriter.SetValue("movies", "extensions", currValue.Replace("," + extension, ""));</p><p> MediaPortal.Profile.Settings.SaveCache();</p><p> return true;</p><p> }</p><p> </p><p> }</p><p> }</p><p> return false;</p><p> }[/code]</p><p> </p><p>The code is above. Please someone help, so that i can push a fix out.</p></blockquote><p></p>
[QUOTE="1stdead, post: 984341, member: 66469"] Ok, trying once again.. You won't get this to work with 1.3 as there might have been some changes in MP - at least that was my findings when testing it. So if any developer could look through this code, we might get it to work again. I updated it to work properly and added support for mp4, BUT there's currently a bug in the code adding/removing the rar extensions from mediaportal.xml.. I couldn't locate that. Perhaps someone could help? [code]//css_reference "MpeCore.dll"; //css_reference "Utils.dll"; using MpeCore.Classes; using MpeCore; using System.Diagnostics; using System; using MediaPortal.Profile; public class Script { public static void Main(PackageClass packageClass, ActionItem actionItem) { ProcessStartInfo psi = new ProcessStartInfo(); psi.WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.System); psi.FileName = "cmd.exe"; psi.Arguments = "/c regsvr32 /s \"" + MpeInstaller.TransformInRealPath(@"%Base%\RARFileSource.ax") + "\""; psi.Verb = "runas"; psi.CreateNoWindow = true; psi.WindowStyle = ProcessWindowStyle.Hidden; psi.ErrorDialog = false; try { Process p = System.Diagnostics.Process.Start(psi); p.WaitForExit(10000); addVideoExtension(".rar"); } catch { } } // add the extension static bool addVideoExtension(string extension) { using (MediaPortal.Profile.Settings xmlwriter = new MPSettings()) { string currValue = xmlwriter.GetValue("movies", "extensions"); if(!currValue.ToLower().Contains(extension)) { xmlwriter.SetValue("movies", "extensions", currValue + "," + extension); MediaPortal.Profile.Settings.SaveCache(); return true; } } return false; } }[/code] [code]//css_reference "Utils.dll"; using MpeCore.Classes; using MpeCore; using System.Diagnostics; using System; using System.IO; using MediaPortal.Profile; using System.Windows.Forms; public class Script { public static void Main(PackageClass packageClass, UnInstallItem actionItem) { string rarfilter = MpeInstaller.TransformInRealPath(@"%Base%\RARFileSource.ax"); ProcessStartInfo psi = new ProcessStartInfo(); psi.WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.System); psi.FileName = "cmd.exe"; psi.Arguments = "/c regsvr32 /s /u \"" + rarfilter + "\""; psi.Verb = "runas"; psi.CreateNoWindow = true; psi.WindowStyle = ProcessWindowStyle.Hidden; psi.ErrorDialog = false; try { Process p = System.Diagnostics.Process.Start(psi); p.WaitForExit(10000); if (File.Exists(rarfilter)) File.Delete(rarfilter ); removeVideoExtension(".rar"); } catch { } } // remove the extension static bool removeVideoExtension(string extension) { using (MediaPortal.Profile.Settings xmlwriter = new MPSettings()) { string currValue = xmlwriter.GetValue("movies", "extensions"); if(currValue.ToLower().Contains(extension)) { if (MessageBox.Show("Would you like to remove the .rar Extension as a Video Extension?", "Remove Extension", MessageBoxButtons.YesNo) == DialogResult.Yes) { xmlwriter.SetValue("movies", "extensions", currValue.Replace("," + extension, "")); MediaPortal.Profile.Settings.SaveCache(); return true; } } } return false; }[/code] The code is above. Please someone help, so that i can push a fix out. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Plugin: RARFileSource (A rar filter)
Contact us
RSS
Top
Bottom