- July 25, 2010
- 4,024
- 1,420
- Home Country
-
Germany
@offbyone I think the title says it all. johanj requested that I add OnlineVideos Support to MP2Ext. I already did this and it looks like it is working great as a server plugin. 
I had only a few problems which I would like to discuss with you:
1) In the 3rd Party folder of the OnlineVideos.dll was the whole src of the Newtonsoft.Json parser. This is a problem because I am importing it as a NugetPackage which leads to Namespace conflicts with the OnlineVideos.dll.
I deleted it from the Project and also imported the Nuget package. This is working for the OnlineVideos.dll but not for the SiteUtils. Some of them are now failing because they can't find the Json parser inside the OnlineVideos.dll.
Do you think we could add some kind of proxy to the onlinevideos.dll? I don't know how many functions are used inside the siteUtils, but most likely only JsonConvert.DeserializeObject, right?
Or do you have a better idea?
2) FileUtils.cs internal static DateTime RetrieveLinkerTimestamp(string filePath) @ Line 67
There is a Try{}finally block, but the Catch block is missing, so it was always throwing an unhanled exception, I've changed it to:
Could you add it to the Mainversion?
The cause of this is Problem 3)
3) PluginLoader.cs internal void LoadAllSiteUtilDlls(string path) @ Line: 35 or 36 (I added a Log Line locally)
Why do you use new Uri? Is there a reason for that?
I've added this log line:
The result is:
As you can see new Uri() cuts of the path because of "#" in the file path. So is it really needed?
It would be great if we could resolve these three issues and I am looking forward to hear back from you.
I had only a few problems which I would like to discuss with you:
1) In the 3rd Party folder of the OnlineVideos.dll was the whole src of the Newtonsoft.Json parser. This is a problem because I am importing it as a NugetPackage which leads to Namespace conflicts with the OnlineVideos.dll.
I deleted it from the Project and also imported the Nuget package. This is working for the OnlineVideos.dll but not for the SiteUtils. Some of them are now failing because they can't find the Json parser inside the OnlineVideos.dll.
Do you think we could add some kind of proxy to the onlinevideos.dll? I don't know how many functions are used inside the siteUtils, but most likely only JsonConvert.DeserializeObject, right?
Or do you have a better idea?
2) FileUtils.cs internal static DateTime RetrieveLinkerTimestamp(string filePath) @ Line 67
There is a Try{}finally block, but the Catch block is missing, so it was always throwing an unhanled exception, I've changed it to:
Code:
try
{
s = new FileStream(filePath, FileMode.Open, FileAccess.Read);
s.Read(b, 0, 2048);
}
catch (Exception e)
{
Log.Error("Couldn't retrieve Linker Timestamp: {0}", e.Message);
}
finally
{
if (s != null)
{
s.Close();
}
}
The cause of this is Problem 3)
3) PluginLoader.cs internal void LoadAllSiteUtilDlls(string path) @ Line: 35 or 36 (I added a Log Line locally)
Code:
Log.Info("ExecutingAssembly: {0} - Code Base: {1} - Uri: {2}", Assembly.GetExecutingAssembly(), Assembly.GetExecutingAssembly().CodeBase, new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);
Why do you use new Uri? Is there a reason for that?
I've added this log line:
Code:
Log.Info("ExecutingAssembly: {0} - Code Base: {1} - Uri: {2}", Assembly.GetExecutingAssembly(), Assembly.GetExecutingAssembly().CodeBase, new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);
[2015-11-26 21:42:20,620] [2933 ] [Main ] [INFO ] - [OnlineVideos] ExecutingAssembly: OnlineVideos, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null - Code Base: file:///M:/Programmieren/C#/MediaPortal 2/MediaPortal/Bin/MP2-Server/bin/x86/Debug/Plugins/MP2Extended/OnlineVideos.DLL - Uri: M:\Programmieren\C
As you can see new Uri() cuts of the path because of "#" in the file path. So is it really needed?
It would be great if we could resolve these three issues and I am looking forward to hear back from you.