Pārlūkot izejas kodu

Merge pull request #1 from jellyfin/master

Update Local fork to current master for rebase
LogicalPhallacy 6 gadi atpakaļ
vecāks
revīzija
3389376672
4 mainītis faili ar 125 papildinājumiem un 91 dzēšanām
  1. 3 0
      .gitmodules
  2. 1 3
      Emby.Photos/Emby.Photos.csproj
  3. 80 83
      Emby.Photos/PhotoProvider.cs
  4. 41 5
      README.md

+ 3 - 0
.gitmodules

@@ -0,0 +1,3 @@
+[submodule "ThirdParty/taglib-sharp"]
+	path = ThirdParty/taglib-sharp
+	url = git@github.com:mono/taglib-sharp.git

+ 1 - 3
Emby.Photos/Emby.Photos.csproj

@@ -3,9 +3,7 @@
   <ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />
     <ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />
     <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
     <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
-    <Reference Include="TagLib.Portable">
-      <HintPath>..\ThirdParty\taglib\TagLib.Portable.dll</HintPath>
-    </Reference>
+    <ProjectReference Include="..\ThirdParty\taglib-sharp\src\taglib-sharp.csproj" />
   </ItemGroup>
   </ItemGroup>
 
 
   <ItemGroup>
   <ItemGroup>

+ 80 - 83
Emby.Photos/PhotoProvider.cs

@@ -57,118 +57,115 @@ namespace Emby.Photos
             {
             {
                 try
                 try
                 {
                 {
-                    using (var fileStream = _fileSystem.OpenRead(item.Path))
+                    using (var file = TagLib.File.Create(item.Path))
                     {
                     {
-                        using (var file = TagLib.File.Create(new StreamFileAbstraction(Path.GetFileName(item.Path), fileStream, null)))
-                        {
-                            var image = file as TagLib.Image.File;
+                        var image = file as TagLib.Image.File;
+
+                        var tag = file.GetTag(TagTypes.TiffIFD) as IFDTag;
 
 
-                            var tag = file.GetTag(TagTypes.TiffIFD) as IFDTag;
+                        if (tag != null)
+                        {
+                            var structure = tag.Structure;
 
 
-                            if (tag != null)
+                            if (structure != null)
                             {
                             {
-                                var structure = tag.Structure;
+                                var exif = structure.GetEntry(0, (ushort)IFDEntryTag.ExifIFD) as SubIFDEntry;
 
 
-                                if (structure != null)
+                                if (exif != null)
                                 {
                                 {
-                                    var exif = structure.GetEntry(0, (ushort)IFDEntryTag.ExifIFD) as SubIFDEntry;
+                                    var exifStructure = exif.Structure;
 
 
-                                    if (exif != null)
+                                    if (exifStructure != null)
                                     {
                                     {
-                                        var exifStructure = exif.Structure;
+                                        var entry = exifStructure.GetEntry(0, (ushort)ExifEntryTag.ApertureValue) as RationalIFDEntry;
 
 
-                                        if (exifStructure != null)
+                                        if (entry != null)
                                         {
                                         {
-                                            var entry = exifStructure.GetEntry(0, (ushort)ExifEntryTag.ApertureValue) as RationalIFDEntry;
-
-                                            if (entry != null)
-                                            {
-                                                double val = entry.Value.Numerator;
-                                                val /= entry.Value.Denominator;
-                                                item.Aperture = val;
-                                            }
-
-                                            entry = exifStructure.GetEntry(0, (ushort)ExifEntryTag.ShutterSpeedValue) as RationalIFDEntry;
-
-                                            if (entry != null)
-                                            {
-                                                double val = entry.Value.Numerator;
-                                                val /= entry.Value.Denominator;
-                                                item.ShutterSpeed = val;
-                                            }
+                                            double val = entry.Value.Numerator;
+                                            val /= entry.Value.Denominator;
+                                            item.Aperture = val;
+                                        }
+
+                                        entry = exifStructure.GetEntry(0, (ushort)ExifEntryTag.ShutterSpeedValue) as RationalIFDEntry;
+
+                                        if (entry != null)
+                                        {
+                                            double val = entry.Value.Numerator;
+                                            val /= entry.Value.Denominator;
+                                            item.ShutterSpeed = val;
                                         }
                                         }
                                     }
                                     }
                                 }
                                 }
                             }
                             }
+                        }
 
 
-                            if (image != null)
-                            {
-                                item.CameraMake = image.ImageTag.Make;
-                                item.CameraModel = image.ImageTag.Model;
+                        if (image != null)
+                        {
+                            item.CameraMake = image.ImageTag.Make;
+                            item.CameraModel = image.ImageTag.Model;
 
 
-                                item.Width = image.Properties.PhotoWidth;
-                                item.Height = image.Properties.PhotoHeight;
+                            item.Width = image.Properties.PhotoWidth;
+                            item.Height = image.Properties.PhotoHeight;
 
 
-                                var rating = image.ImageTag.Rating;
-                                if (rating.HasValue)
-                                {
-                                    item.CommunityRating = rating;
-                                }
-                                else
-                                {
-                                    item.CommunityRating = null;
-                                }
+                            var rating = image.ImageTag.Rating;
+                            if (rating.HasValue)
+                            {
+                                item.CommunityRating = rating;
+                            }
+                            else
+                            {
+                                item.CommunityRating = null;
+                            }
 
 
-                                item.Overview = image.ImageTag.Comment;
+                            item.Overview = image.ImageTag.Comment;
 
 
-                                if (!string.IsNullOrWhiteSpace(image.ImageTag.Title))
+                            if (!string.IsNullOrWhiteSpace(image.ImageTag.Title))
+                            {
+                                if (!item.LockedFields.Contains(MetadataFields.Name))
                                 {
                                 {
-                                    if (!item.LockedFields.Contains(MetadataFields.Name))
-                                    {
-                                        item.Name = image.ImageTag.Title;
-                                    }
+                                    item.Name = image.ImageTag.Title;
                                 }
                                 }
+                            }
 
 
-                                var dateTaken = image.ImageTag.DateTime;
-                                if (dateTaken.HasValue)
-                                {
-                                    item.DateCreated = dateTaken.Value;
-                                    item.PremiereDate = dateTaken.Value;
-                                    item.ProductionYear = dateTaken.Value.Year;
-                                }
+                            var dateTaken = image.ImageTag.DateTime;
+                            if (dateTaken.HasValue)
+                            {
+                                item.DateCreated = dateTaken.Value;
+                                item.PremiereDate = dateTaken.Value;
+                                item.ProductionYear = dateTaken.Value.Year;
+                            }
 
 
-                                item.Genres = image.ImageTag.Genres;
-                                item.Tags = image.ImageTag.Keywords;
-                                item.Software = image.ImageTag.Software;
+                            item.Genres = image.ImageTag.Genres;
+                            item.Tags = image.ImageTag.Keywords;
+                            item.Software = image.ImageTag.Software;
 
 
-                                if (image.ImageTag.Orientation == TagLib.Image.ImageOrientation.None)
-                                {
-                                    item.Orientation = null;
-                                }
-                                else
+                            if (image.ImageTag.Orientation == TagLib.Image.ImageOrientation.None)
+                            {
+                                item.Orientation = null;
+                            }
+                            else
+                            {
+                                MediaBrowser.Model.Drawing.ImageOrientation orientation;
+                                if (Enum.TryParse(image.ImageTag.Orientation.ToString(), true, out orientation))
                                 {
                                 {
-                                    MediaBrowser.Model.Drawing.ImageOrientation orientation;
-                                    if (Enum.TryParse(image.ImageTag.Orientation.ToString(), true, out orientation))
-                                    {
-                                        item.Orientation = orientation;
-                                    }
+                                    item.Orientation = orientation;
                                 }
                                 }
+                            }
 
 
-                                item.ExposureTime = image.ImageTag.ExposureTime;
-                                item.FocalLength = image.ImageTag.FocalLength;
+                            item.ExposureTime = image.ImageTag.ExposureTime;
+                            item.FocalLength = image.ImageTag.FocalLength;
 
 
-                                item.Latitude = image.ImageTag.Latitude;
-                                item.Longitude = image.ImageTag.Longitude;
-                                item.Altitude = image.ImageTag.Altitude;
+                            item.Latitude = image.ImageTag.Latitude;
+                            item.Longitude = image.ImageTag.Longitude;
+                            item.Altitude = image.ImageTag.Altitude;
 
 
-                                if (image.ImageTag.ISOSpeedRatings.HasValue)
-                                {
-                                    item.IsoSpeedRating = Convert.ToInt32(image.ImageTag.ISOSpeedRatings.Value);
-                                }
-                                else
-                                {
-                                    item.IsoSpeedRating = null;
-                                }
+                            if (image.ImageTag.ISOSpeedRatings.HasValue)
+                            {
+                                item.IsoSpeedRating = Convert.ToInt32(image.ImageTag.ISOSpeedRatings.Value);
+                            }
+                            else
+                            {
+                                item.IsoSpeedRating = null;
                             }
                             }
                         }
                         }
                     }
                     }

+ 41 - 5
README.md

@@ -13,16 +13,52 @@ While our first priority is a stable build, we will eventually add features that
 
 
 [Feature Requests](http://feathub.com/jellyfin/jellyfin)
 [Feature Requests](http://feathub.com/jellyfin/jellyfin)
 
 
-## Building Jellyfin packages
+## Prebuilt Jellyfin packages
+
+Prebuild packages are available for Debian/Ubuntu and Arch, and via Docker Hub.
+
+### Docker
+
+The Jellyfin Docker image is available on Docker Hub at https://hub.docker.com/r/jellyfin/jellyfin/
+
+### Arch
+
+The Jellyfin package is in the AUR at https://aur.archlinux.org/packages/jellyfin-git/
+
+### Debian/Ubuntu
+
+A package repository is available at https://repo.jellyfin.org. To use it:
+
+0. Install the `dotnet-runtime-2.1` package via [Microsoft's repositories](https://dotnet.microsoft.com/download/dotnet-core/2.1).
+0. Import the GPG signing key (signed by Joshua):
+    ```
+    wget -O - https://repo.jellyfin.org/debian/jellyfin-signing-key-joshua.gpg.key | sudo apt-key add -
+    ```
+0. Add an entry to `/etc/apt/sources.list.d/jellyfin.list` (note that Ubuntu will get `buster` but this should work fine):
+    ```
+    echo "deb https://repo.jellyfin.org/debian $( grep -Ewo -m1 --color=none 'jessie|stretch|buster' /etc/os-release || echo buster ) main" | sudo tee /etc/apt/sources.list.d/jellyfin.list
+    ```
+0. Update APT repositories:
+    ```
+    sudo apt update
+    ```
+0. Install Jellyfin:
+    ```
+    sudo apt install jellyfin
+    ```
+
+## Building Jellyfin packages from source
 
 
 Jellyfin seeks to integrate build facilities for any desired packaging format. Instructions for the various formats can be found below.
 Jellyfin seeks to integrate build facilities for any desired packaging format. Instructions for the various formats can be found below.
 
 
+NOTE: When building from source, only cloning the full Git repository is supported, rather than using a `.zip`/`.tar` archive, in order to support submodules.
+
 ### Debian/Ubuntu
 ### Debian/Ubuntu
 
 
 Debian build facilities are integrated into the repo at `debian/`.
 Debian build facilities are integrated into the repo at `debian/`.
 
 
-1. Install the `dotnet-sdk-2.1` package via [Microsoft's repositories](https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-2.1.500).
-2. Run `dpkg-buildpackage -us -uc -jX`, where X is your core count.
-3. Install the resulting `jellyfin*.deb` file on your system.
+1. Install the `dotnet-sdk-2.1` package via [Microsoft's repositories](https://dotnet.microsoft.com/download/dotnet-core/2.1).
+2. Run `dpkg-buildpackage -us -uc`.
+3. Install the resulting `jellyfin_*.deb` file on your system.
 
 
-A huge thanks to Carlos Hernandez who created the Debian build configuration for Emby 3.1.1.
+A huge thanks to Carlos Hernandez who created the original Debian build configuration for Emby 3.1.1.