diff --git a/Emby.Photos/Emby.Photos.csproj b/Emby.Photos/Emby.Photos.csproj
new file mode 100644
index 0000000000..efc15519ff
--- /dev/null
+++ b/Emby.Photos/Emby.Photos.csproj
@@ -0,0 +1,72 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}
+ Library
+ Properties
+ Emby.Photos
+ Emby.Photos
+ v4.6
+ 512
+
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+ ..\ThirdParty\taglib\taglib-sharp.dll
+
+
+
+
+
+
+
+
+ {9142eefa-7570-41e1-bfcc-468bb571af2f}
+ MediaBrowser.Common
+
+
+ {17e1f4e6-8abd-4fe5-9ecf-43d4b6087ba2}
+ MediaBrowser.Controller
+
+
+ {7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b}
+ MediaBrowser.Model
+
+
+
+
+
\ No newline at end of file
diff --git a/MediaBrowser.Providers/Photos/PhotoProvider.cs b/Emby.Photos/PhotoProvider.cs
similarity index 97%
rename from MediaBrowser.Providers/Photos/PhotoProvider.cs
rename to Emby.Photos/PhotoProvider.cs
index c48c3d09be..aa9b36f172 100644
--- a/MediaBrowser.Providers/Photos/PhotoProvider.cs
+++ b/Emby.Photos/PhotoProvider.cs
@@ -1,18 +1,18 @@
-using MediaBrowser.Controller.Entities;
+using System;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
-using System;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
using TagLib;
using TagLib.IFD;
using TagLib.IFD.Entries;
using TagLib.IFD.Tags;
-namespace MediaBrowser.Providers.Photos
+namespace Emby.Photos
{
public class PhotoProvider : ICustomMetadataProvider, IHasItemChangeMonitor, IForcedProvider
{
@@ -114,7 +114,7 @@ namespace MediaBrowser.Providers.Photos
}
else
{
- Model.Drawing.ImageOrientation orientation;
+ MediaBrowser.Model.Drawing.ImageOrientation orientation;
if (Enum.TryParse(image.ImageTag.Orientation.ToString(), true, out orientation))
{
item.Orientation = orientation;
diff --git a/Emby.Photos/Properties/AssemblyInfo.cs b/Emby.Photos/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000..abef142ef1
--- /dev/null
+++ b/Emby.Photos/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Emby.Photos")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Emby.Photos")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("89ab4548-770d-41fd-a891-8daff44f452c")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj
index 1834aaf679..3b017cc4eb 100644
--- a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj
+++ b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj
@@ -76,9 +76,11 @@
+
+
@@ -101,6 +103,10 @@
{7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b}
MediaBrowser.Model
+
+ {4a4402d4-e910-443b-b8fc-2c18286a2ca0}
+ OpenSubtitlesHandler
+
diff --git a/MediaBrowser.Providers/Subtitles/ConfigurationExtension.cs b/MediaBrowser.MediaEncoding/Subtitles/ConfigurationExtension.cs
similarity index 85%
rename from MediaBrowser.Providers/Subtitles/ConfigurationExtension.cs
rename to MediaBrowser.MediaEncoding/Subtitles/ConfigurationExtension.cs
index f520915d8b..973c653a47 100644
--- a/MediaBrowser.Providers/Subtitles/ConfigurationExtension.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/ConfigurationExtension.cs
@@ -1,8 +1,8 @@
-using MediaBrowser.Common.Configuration;
+using System.Collections.Generic;
+using MediaBrowser.Common.Configuration;
using MediaBrowser.Model.Providers;
-using System.Collections.Generic;
-namespace MediaBrowser.Providers.Subtitles
+namespace MediaBrowser.MediaEncoding.Subtitles
{
public static class ConfigurationExtension
{
diff --git a/MediaBrowser.Providers/Subtitles/OpenSubtitleDownloader.cs b/MediaBrowser.MediaEncoding/Subtitles/OpenSubtitleDownloader.cs
similarity index 99%
rename from MediaBrowser.Providers/Subtitles/OpenSubtitleDownloader.cs
rename to MediaBrowser.MediaEncoding/Subtitles/OpenSubtitleDownloader.cs
index 271f8170fc..a58da3dc8b 100644
--- a/MediaBrowser.Providers/Subtitles/OpenSubtitleDownloader.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/OpenSubtitleDownloader.cs
@@ -1,4 +1,11 @@
-using MediaBrowser.Common.Configuration;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
@@ -11,15 +18,8 @@ using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Providers;
using MediaBrowser.Model.Serialization;
using OpenSubtitlesHandler;
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-namespace MediaBrowser.Providers.Subtitles
+namespace MediaBrowser.MediaEncoding.Subtitles
{
public class OpenSubtitleDownloader : ISubtitleProvider, IDisposable
{
diff --git a/MediaBrowser.Providers/MediaBrowser.Providers.csproj b/MediaBrowser.Providers/MediaBrowser.Providers.csproj
index 3fcdbf1c75..4808dae1a2 100644
--- a/MediaBrowser.Providers/MediaBrowser.Providers.csproj
+++ b/MediaBrowser.Providers/MediaBrowser.Providers.csproj
@@ -55,10 +55,6 @@
-
- False
- ..\ThirdParty\taglib\taglib-sharp.dll
-
@@ -131,16 +127,12 @@
-
-
-
-
@@ -182,10 +174,6 @@
{7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}
MediaBrowser.Model
-
- {4a4402d4-e910-443b-b8fc-2c18286a2ca0}
- OpenSubtitlesHandler
-
diff --git a/MediaBrowser.Providers/Photos/PhotoHelper.cs b/MediaBrowser.Providers/Photos/PhotoHelper.cs
deleted file mode 100644
index 2334c792e7..0000000000
--- a/MediaBrowser.Providers/Photos/PhotoHelper.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-using System;
-using System.Text;
-
-namespace MediaBrowser.Providers.Photos
-{
- public static class PhotoHelper
- {
- public static string Dec2Frac(double dbl)
- {
- char neg = ' ';
- double dblDecimal = dbl;
- if (dblDecimal == (int)dblDecimal) return dblDecimal.ToString(); //return no if it's not a decimal
- if (dblDecimal < 0)
- {
- dblDecimal = Math.Abs(dblDecimal);
- neg = '-';
- }
- var whole = (int)Math.Truncate(dblDecimal);
- string decpart = dblDecimal.ToString().Replace(Math.Truncate(dblDecimal) + ".", "");
- double rN = Convert.ToDouble(decpart);
- double rD = Math.Pow(10, decpart.Length);
-
- string rd = Recur(decpart);
- int rel = Convert.ToInt32(rd);
- if (rel != 0)
- {
- rN = rel;
- rD = (int)Math.Pow(10, rd.Length) - 1;
- }
- //just a few prime factors for testing purposes
- var primes = new[] { 47, 43, 37, 31, 29, 23, 19, 17, 13, 11, 7, 5, 3, 2 };
- foreach (int i in primes) ReduceNo(i, ref rD, ref rN);
-
- rN = rN + (whole * rD);
- return string.Format("{0}{1}/{2}", neg, rN, rD);
- }
-
- ///
- /// Finds out the recurring decimal in a specified number
- ///
- /// Number to check
- ///
- private static string Recur(string db)
- {
- if (db.Length < 13) return "0";
- var sb = new StringBuilder();
- for (int i = 0; i < 7; i++)
- {
- sb.Append(db[i]);
- int dlength = (db.Length / sb.ToString().Length);
- int occur = Occurence(sb.ToString(), db);
- if (dlength == occur || dlength == occur - sb.ToString().Length)
- {
- return sb.ToString();
- }
- }
- return "0";
- }
-
- ///
- /// Checks for number of occurence of specified no in a number
- ///
- /// The no to check occurence times
- /// The number where to check this
- ///
- private static int Occurence(string s, string check)
- {
- int i = 0;
- int d = s.Length;
- string ds = check;
- for (int n = (ds.Length / d); n > 0; n--)
- {
- if (ds.Contains(s))
- {
- i++;
- ds = ds.Remove(ds.IndexOf(s, System.StringComparison.Ordinal), d);
- }
- }
- return i;
- }
-
- ///
- /// Reduces a fraction given the numerator and denominator
- ///
- /// Number to use in an attempt to reduce fraction
- /// the Denominator
- /// the Numerator
- private static void ReduceNo(int i, ref double rD, ref double rN)
- {
- //keep reducing until divisibility ends
- while ((rD % i) < 1e-10 && (rN % i) < 1e-10)
- {
- rN = rN / i;
- rD = rD / i;
- }
- }
- }
-}
diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
index bc62516c76..667f6b89af 100644
--- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
+++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
@@ -1112,7 +1112,10 @@ namespace MediaBrowser.Server.Implementations.Persistence
private string SerializeProviderIds(BaseItem item)
{
- var ids = item.ProviderIds.ToList();
+ // Ideally we shouldn't need this IsNullOrWhiteSpace check but we're seeing some cases of bad data slip through
+ var ids = item.ProviderIds
+ .Where(i => !string.IsNullOrWhiteSpace(i.Value))
+ .ToList();
if (ids.Count == 0)
{
@@ -4889,6 +4892,15 @@ namespace MediaBrowser.Server.Implementations.Persistence
foreach (var pair in newValues)
{
+ if (string.IsNullOrWhiteSpace(pair.Key))
+ {
+ continue;
+ }
+ if (string.IsNullOrWhiteSpace(pair.Value))
+ {
+ continue;
+ }
+
_saveProviderIdsCommand.GetParameter(0).Value = itemId;
_saveProviderIdsCommand.GetParameter(1).Value = pair.Key;
_saveProviderIdsCommand.GetParameter(2).Value = pair.Value;
diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
index f8294a24d7..23b6dd0976 100644
--- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
+++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
@@ -96,6 +96,7 @@ using System.Net.Sockets;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
+using Emby.Photos;
using MediaBrowser.Model.IO;
using MediaBrowser.Api.Playback;
using MediaBrowser.Common.Implementations.Networking;
@@ -1232,6 +1233,9 @@ namespace MediaBrowser.Server.Startup.Common
// Include composable parts in the Providers assembly
list.Add(typeof(ProviderUtils).Assembly);
+ // Include composable parts in the Photos assembly
+ list.Add(typeof(PhotoProvider).Assembly);
+
// Common implementations
list.Add(typeof(TaskManager).Assembly);
diff --git a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj
index deab10804e..245231ecaf 100644
--- a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj
+++ b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj
@@ -85,6 +85,10 @@
{08fff49b-f175-4807-a2b5-73b0ebd9f716}
Emby.Drawing
+
+ {89ab4548-770d-41fd-a891-8daff44f452c}
+ Emby.Photos
+
{4fd51ac5-2c16-4308-a993-c3a84f3b4582}
MediaBrowser.Api
diff --git a/MediaBrowser.sln b/MediaBrowser.sln
index 459598e854..e8ceff89b8 100644
--- a/MediaBrowser.sln
+++ b/MediaBrowser.sln
@@ -62,6 +62,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Emby.Drawing", "Emby.Drawin
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Nat", "Mono.Nat\Mono.Nat.csproj", "{D7453B88-2266-4805-B39B-2B5A2A33E1BA}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Emby.Photos", "Emby.Photos\Emby.Photos.csproj", "{89AB4548-770D-41FD-A891-8DAFF44F452C}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -508,6 +510,36 @@ Global
{D7453B88-2266-4805-B39B-2B5A2A33E1BA}.Release|x64.Build.0 = Release|Any CPU
{D7453B88-2266-4805-B39B-2B5A2A33E1BA}.Release|x86.ActiveCfg = Release|Any CPU
{D7453B88-2266-4805-B39B-2B5A2A33E1BA}.Release|x86.Build.0 = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Debug|Win32.ActiveCfg = Debug|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Debug|Win32.Build.0 = Debug|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Debug|x64.Build.0 = Debug|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Debug|x86.Build.0 = Debug|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release Mono|Any CPU.ActiveCfg = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release Mono|Any CPU.Build.0 = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release Mono|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release Mono|Mixed Platforms.Build.0 = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release Mono|Win32.ActiveCfg = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release Mono|Win32.Build.0 = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release Mono|x64.ActiveCfg = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release Mono|x64.Build.0 = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release Mono|x86.ActiveCfg = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release Mono|x86.Build.0 = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release|Win32.ActiveCfg = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release|Win32.Build.0 = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release|x64.ActiveCfg = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release|x64.Build.0 = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release|x86.ActiveCfg = Release|Any CPU
+ {89AB4548-770D-41FD-A891-8DAFF44F452C}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE