Merge remote-tracking branch 'upstream/dev' into build-system-consolidation

This commit is contained in:
Erwin de Haan 2019-01-13 23:28:05 +01:00
commit ae0732136f
569 changed files with 4929 additions and 6093 deletions

View file

@ -3,11 +3,11 @@
# For emacs, vim, np++ and other editors, see here: https://github.com/editorconfig # For emacs, vim, np++ and other editors, see here: https://github.com/editorconfig
############################### ###############################
# Core EditorConfig Options # # Core EditorConfig Options #
############################### ###############################
root = true
# All files # All files
[*] [*]
indent_style = space indent_style = space
root = true
indent_size = 4 indent_size = 4
charset = utf-8 charset = utf-8
trim_trailing_whitespace = true trim_trailing_whitespace = true

35
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View file

@ -0,0 +1,35 @@
---
name: Bug report
about: Create a bug report
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Logs**
Please paste any log errors.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**System (please complete the following information):**
- OS: [e.g. Docker, Debian, Windows]
- Browser: [e.g. Firefox, Chrome, Safari]
- Jellyfin Version: [e.g. 10.0.1]
**Additional context**
Add any other context about the problem here.

View file

@ -0,0 +1,20 @@
---
name: Enhancement request
about: Suggest an modification to an existing feature
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View file

@ -0,0 +1,14 @@
---
name: Feature request
about: Suggest a new feature
title: ''
labels: feature
assignees: ''
---
**Describe the feature you'd like**
A clear and concise description of what you want to happen.
**Additional context**
Add any other context or screenshots about the feature request here.

9
.github/pull_request_template.md vendored Normal file
View file

@ -0,0 +1,9 @@
Ensure your title is short, descriptive, and in the imperative mood (Fix X, Change Y, instead of Fixed X, Changed Y).
For a good inspiration of what to write in commit messages and PRs please review https://chris.beams.io/posts/git-commit/ and our https://jellyfin.readthedocs.io/en/latest/developer-docs/contributing/ page.
**Changes**
Describe your changes here in 1-5 sentences.
**Issues**
Tag any issues that this PR solves here.
Fixes #

View file

@ -1,5 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<Compile Include="..\SharedVersion.cs" Link="SharedVersion.cs" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" /> <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
</ItemGroup> </ItemGroup>

View file

@ -77,7 +77,7 @@ namespace BDInfo
{ {
if (string.IsNullOrEmpty(path)) if (string.IsNullOrEmpty(path))
{ {
throw new ArgumentNullException("path"); throw new ArgumentNullException(nameof(path));
} }
_fileSystem = fileSystem; _fileSystem = fileSystem;
@ -235,7 +235,7 @@ namespace BDInfo
break; break;
} }
} }
else throw ex; else throw;
} }
} }
@ -273,7 +273,7 @@ namespace BDInfo
break; break;
} }
} }
else throw ex; else throw;
} }
} }
@ -310,7 +310,7 @@ namespace BDInfo
break; break;
} }
} }
else throw ex; else throw;
} }
} }
@ -336,7 +336,7 @@ namespace BDInfo
{ {
if (string.IsNullOrEmpty(path)) if (string.IsNullOrEmpty(path))
{ {
throw new ArgumentNullException("path"); throw new ArgumentNullException(nameof(path));
} }
FileSystemMetadata dir = _fileSystem.GetDirectoryInfo(path); FileSystemMetadata dir = _fileSystem.GetDirectoryInfo(path);

View file

@ -1,29 +1,21 @@
using System.Resources;
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Resources;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("BDInfo")] [assembly: AssemblyTitle("BDInfo")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("Jellyfin Project")]
[assembly: AssemblyProduct("BDInfo")] [assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
[assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyCopyright("Copyright © 2016 CinemaSquid. Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")] [assembly: NeutralResourcesLanguage("en")]
// Version information for an assembly consists of the following four values: // 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
// Major Version // COM, set the ComVisible attribute to true on that type.
// Minor Version [assembly: ComVisible(false)]
// 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.1")]

View file

@ -148,7 +148,7 @@ namespace BDInfo
stream.IsVBR = true; stream.IsVBR = true;
stream.IsInitialized = true; stream.IsInitialized = true;
break; break;
default: default:
stream.IsVBR = false; stream.IsVBR = false;
stream.IsInitialized = true; stream.IsInitialized = true;

View file

@ -22,9 +22,9 @@ namespace BDInfo
{ {
public abstract class TSCodecDTSHD public abstract class TSCodecDTSHD
{ {
private static int[] SampleRates = new int[] private static int[] SampleRates = new int[]
{ 0x1F40, 0x3E80, 0x7D00, 0x0FA00, 0x1F400, 0x5622, 0x0AC44, 0x15888, 0x2B110, 0x56220, 0x2EE0, 0x5DC0, 0x0BB80, 0x17700, 0x2EE00, 0x5DC00 }; { 0x1F40, 0x3E80, 0x7D00, 0x0FA00, 0x1F400, 0x5622, 0x0AC44, 0x15888, 0x2B110, 0x56220, 0x2EE0, 0x5DC0, 0x0BB80, 0x17700, 0x2EE00, 0x5DC00 };
public static void Scan( public static void Scan(
TSAudioStream stream, TSAudioStream stream,
TSStreamBuffer buffer, TSStreamBuffer buffer,
@ -131,7 +131,7 @@ namespace BDInfo
else else
{ {
AssetSizes[i] = buffer.ReadBits(16) + 1; AssetSizes[i] = buffer.ReadBits(16) + 1;
} }
} }
for (int i = 0; i < nuNumAssets; i++) for (int i = 0; i < nuNumAssets; i++)
{ {
@ -189,7 +189,7 @@ namespace BDInfo
} }
stream.SampleRate = SampleRates[nuMaxSampleRate]; stream.SampleRate = SampleRates[nuMaxSampleRate];
stream.BitDepth = nuBitResolution; stream.BitDepth = nuBitResolution;
stream.LFE = 0; stream.LFE = 0;
if ((nuSpkrActivityMask & 0x8) == 0x8) if ((nuSpkrActivityMask & 0x8) == 0x8)
{ {
@ -240,7 +240,7 @@ namespace BDInfo
stream.IsInitialized = true; stream.IsInitialized = true;
} }
stream.IsInitialized = (stream.BitRate > 0 ? true : false); stream.IsInitialized = (stream.BitRate > 0 ? true : false);
} }
} }
} }
} }

View file

@ -33,7 +33,7 @@ namespace BDInfo
int pictureParse = 0; int pictureParse = 0;
int sequenceHeaderParse = 0; int sequenceHeaderParse = 0;
int extensionParse = 0; int extensionParse = 0;
int sequenceExtensionParse = 0; int sequenceExtensionParse = 0;
for (int i = 0; i < buffer.Length; i++) for (int i = 0; i < buffer.Length; i++)
{ {
@ -189,7 +189,7 @@ namespace BDInfo
#if DEBUG #if DEBUG
if (sequenceExtensionParse == 0) if (sequenceExtensionParse == 0)
{ {
uint sequenceExtension = uint sequenceExtension =
((parse & 0x8) >> 3); ((parse & 0x8) >> 3);
if (sequenceExtension == 0) if (sequenceExtension == 0)
{ {

View file

@ -36,7 +36,7 @@ namespace BDInfo
for (int i = 0; i < buffer.Length; i++) for (int i = 0; i < buffer.Length; i++)
{ {
sync = (sync << 8) + buffer.ReadByte(); sync = (sync << 8) + buffer.ReadByte();
if (sync == 0xF8726FBA) if (sync == 0xF8726FBA)
{ {
syncFound = true; syncFound = true;
break; break;
@ -63,7 +63,7 @@ namespace BDInfo
int ratebits = buffer.ReadBits(4); int ratebits = buffer.ReadBits(4);
if (ratebits != 0xF) if (ratebits != 0xF)
{ {
stream.SampleRate = stream.SampleRate =
(((ratebits & 8) > 0 ? 44100 : 48000) << (ratebits & 7)); (((ratebits & 8) > 0 ? 44100 : 48000) << (ratebits & 7));
} }
int temp1 = buffer.ReadBits(8); int temp1 = buffer.ReadBits(8);
@ -149,9 +149,9 @@ namespace BDInfo
int peak_bitrate = buffer.ReadBits(15); int peak_bitrate = buffer.ReadBits(15);
peak_bitrate = (peak_bitrate * stream.SampleRate) >> 4; peak_bitrate = (peak_bitrate * stream.SampleRate) >> 4;
double peak_bitdepth = double peak_bitdepth =
(double)peak_bitrate / (double)peak_bitrate /
(stream.ChannelCount + stream.LFE) / (stream.ChannelCount + stream.LFE) /
stream.SampleRate; stream.SampleRate;
if (peak_bitdepth > 14) if (peak_bitdepth > 14)
{ {
@ -164,7 +164,7 @@ namespace BDInfo
#if DEBUG #if DEBUG
System.Diagnostics.Debug.WriteLine(string.Format( System.Diagnostics.Debug.WriteLine(string.Format(
"{0}\t{1}\t{2:F2}", "{0}\t{1}\t{2:F2}",
stream.PID, peak_bitrate, peak_bitdepth)); stream.PID, peak_bitrate, peak_bitdepth));
#endif #endif
/* /*

View file

@ -50,18 +50,18 @@ namespace BDInfo
{ {
if ((parse & 0x80000000) == 0) if ((parse & 0x80000000) == 0)
{ {
pictureType = pictureType =
(uint)((parse & 0x78000000) >> 13); (uint)((parse & 0x78000000) >> 13);
} }
else else
{ {
pictureType = pictureType =
(uint)((parse & 0x3c000000) >> 12); (uint)((parse & 0x3c000000) >> 12);
} }
} }
else else
{ {
pictureType = pictureType =
(uint)((parse & 0xf0000000) >> 14); (uint)((parse & 0xf0000000) >> 14);
} }

View file

@ -42,7 +42,7 @@ namespace BDInfo
public List<double> Chapters = new List<double>(); public List<double> Chapters = new List<double>();
public Dictionary<ushort, TSStream> Streams = public Dictionary<ushort, TSStream> Streams =
new Dictionary<ushort, TSStream>(); new Dictionary<ushort, TSStream>();
public Dictionary<ushort, TSStream> PlaylistStreams = public Dictionary<ushort, TSStream> PlaylistStreams =
new Dictionary<ushort, TSStream>(); new Dictionary<ushort, TSStream>();
@ -50,19 +50,19 @@ namespace BDInfo
new List<TSStreamClip>(); new List<TSStreamClip>();
public List<Dictionary<ushort, TSStream>> AngleStreams = public List<Dictionary<ushort, TSStream>> AngleStreams =
new List<Dictionary<ushort, TSStream>>(); new List<Dictionary<ushort, TSStream>>();
public List<Dictionary<double, TSStreamClip>> AngleClips = public List<Dictionary<double, TSStreamClip>> AngleClips =
new List<Dictionary<double, TSStreamClip>>(); new List<Dictionary<double, TSStreamClip>>();
public int AngleCount = 0; public int AngleCount = 0;
public List<TSStream> SortedStreams = public List<TSStream> SortedStreams =
new List<TSStream>(); new List<TSStream>();
public List<TSVideoStream> VideoStreams = public List<TSVideoStream> VideoStreams =
new List<TSVideoStream>(); new List<TSVideoStream>();
public List<TSAudioStream> AudioStreams = public List<TSAudioStream> AudioStreams =
new List<TSAudioStream>(); new List<TSAudioStream>();
public List<TSTextStream> TextStreams = public List<TSTextStream> TextStreams =
new List<TSTextStream>(); new List<TSTextStream>();
public List<TSGraphicsStream> GraphicsStreams = public List<TSGraphicsStream> GraphicsStreams =
new List<TSGraphicsStream>(); new List<TSGraphicsStream>();
public TSPlaylistFile( public TSPlaylistFile(
@ -388,8 +388,8 @@ namespace BDInfo
#if DEBUG #if DEBUG
Debug.WriteLine(string.Format( Debug.WriteLine(string.Format(
"{0} : {1} -> V:{2} A:{3} PG:{4} IG:{5} 2A:{6} 2V:{7} PIP:{8}", "{0} : {1} -> V:{2} A:{3} PG:{4} IG:{5} 2A:{6} 2V:{7} PIP:{8}",
Name, streamFileName, streamCountVideo, streamCountAudio, streamCountPG, streamCountIG, Name, streamFileName, streamCountVideo, streamCountAudio, streamCountPG, streamCountIG,
streamCountSecondaryAudio, streamCountSecondaryVideo, streamCountPIP)); streamCountSecondaryAudio, streamCountSecondaryVideo, streamCountPIP));
#endif #endif
@ -427,7 +427,7 @@ namespace BDInfo
} }
/* /*
* TODO * TODO
* *
for (int i = 0; i < streamCountPIP; i++) for (int i = 0; i < streamCountPIP; i++)
{ {
TSStream stream = CreatePlaylistStream(data, ref pos); TSStream stream = CreatePlaylistStream(data, ref pos);
@ -955,7 +955,7 @@ namespace BDInfo
} }
public int CompareVideoStreams( public int CompareVideoStreams(
TSVideoStream x, TSVideoStream x,
TSVideoStream y) TSVideoStream y)
{ {
if (x == null && y == null) if (x == null && y == null)
@ -996,7 +996,7 @@ namespace BDInfo
} }
public int CompareAudioStreams( public int CompareAudioStreams(
TSAudioStream x, TSAudioStream x,
TSAudioStream y) TSAudioStream y)
{ {
if (x == y) if (x == y)

View file

@ -109,7 +109,7 @@ namespace BDInfo
public TSDescriptor Clone() public TSDescriptor Clone()
{ {
TSDescriptor descriptor = TSDescriptor descriptor =
new TSDescriptor(Name, (byte)Value.Length); new TSDescriptor(Name, (byte)Value.Length);
Value.CopyTo(descriptor.Value, 0); Value.CopyTo(descriptor.Value, 0);
return descriptor; return descriptor;
@ -153,15 +153,15 @@ namespace BDInfo
private string _LanguageCode; private string _LanguageCode;
public string LanguageCode public string LanguageCode
{ {
get get
{ {
return _LanguageCode; return _LanguageCode;
} }
set set
{ {
_LanguageCode = value; _LanguageCode = value;
LanguageName = LanguageCodes.GetName(value); LanguageName = LanguageCodes.GetName(value);
} }
} }
public bool IsVideoStream public bool IsVideoStream
@ -407,7 +407,7 @@ namespace BDInfo
} }
public abstract TSStream Clone(); public abstract TSStream Clone();
protected void CopyTo(TSStream stream) protected void CopyTo(TSStream stream)
{ {
stream.PID = PID; stream.PID = PID;
@ -435,7 +435,7 @@ namespace BDInfo
public int Width; public int Width;
public int Height; public int Height;
public bool IsInterlaced; public bool IsInterlaced;
public int FrameRateEnumerator; public int FrameRateEnumerator;
public int FrameRateDenominator; public int FrameRateDenominator;
public TSAspectRatio AspectRatio; public TSAspectRatio AspectRatio;
@ -581,7 +581,7 @@ namespace BDInfo
stream.FrameRate = _FrameRate; stream.FrameRate = _FrameRate;
stream.Width = Width; stream.Width = Width;
stream.Height = Height; stream.Height = Height;
stream.IsInterlaced = IsInterlaced; stream.IsInterlaced = IsInterlaced;
stream.FrameRateEnumerator = FrameRateEnumerator; stream.FrameRateEnumerator = FrameRateEnumerator;
stream.FrameRateDenominator = FrameRateDenominator; stream.FrameRateDenominator = FrameRateDenominator;
stream.AspectRatio = AspectRatio; stream.AspectRatio = AspectRatio;

View file

@ -69,7 +69,7 @@ namespace BDInfo
byte[] fileType = new byte[8]; byte[] fileType = new byte[8];
Array.Copy(data, 0, fileType, 0, fileType.Length); Array.Copy(data, 0, fileType, 0, fileType.Length);
FileType = _textEncoding.GetASCIIEncoding().GetString(fileType, 0, fileType.Length); FileType = _textEncoding.GetASCIIEncoding().GetString(fileType, 0, fileType.Length);
if (FileType != "HDMV0100" && if (FileType != "HDMV0100" &&
FileType != "HDMV0200") FileType != "HDMV0200")
@ -78,7 +78,7 @@ namespace BDInfo
"Clip info file {0} has an unknown file type {1}.", "Clip info file {0} has an unknown file type {1}.",
FileInfo.Name, FileType)); FileInfo.Name, FileType));
} }
#if DEBUG #if DEBUG
Debug.WriteLine(string.Format( Debug.WriteLine(string.Format(
"\tFileType: {0}", FileType)); "\tFileType: {0}", FileType));
#endif #endif
@ -110,9 +110,9 @@ namespace BDInfo
TSStream stream = null; TSStream stream = null;
ushort PID = (ushort) ushort PID = (ushort)
((clipData[streamOffset] << 8) + ((clipData[streamOffset] << 8) +
clipData[streamOffset + 1]); clipData[streamOffset + 1]);
streamOffset += 2; streamOffset += 2;
TSStreamType streamType = (TSStreamType) TSStreamType streamType = (TSStreamType)
@ -240,7 +240,7 @@ namespace BDInfo
} }
streamOffset += clipData[streamOffset] + 1; streamOffset += clipData[streamOffset] + 1;
} }
IsValid = true; IsValid = true;
} }
finally finally

View file

@ -391,7 +391,7 @@ namespace BDInfo
} }
Dictionary<ushort, TSStream> playlistStreams = playlist.Streams; Dictionary<ushort, TSStream> playlistStreams = playlist.Streams;
if (clip.AngleIndex > 0 && if (clip.AngleIndex > 0 &&
clip.AngleIndex < playlist.AngleStreams.Count + 1) clip.AngleIndex < playlist.AngleStreams.Count + 1)
{ {
playlistStreams = playlist.AngleStreams[clip.AngleIndex - 1]; playlistStreams = playlist.AngleStreams[clip.AngleIndex - 1];
@ -428,7 +428,7 @@ namespace BDInfo
TSStream stream = Streams[PID]; TSStream stream = Streams[PID];
stream.PayloadBytes += streamState.WindowBytes; stream.PayloadBytes += streamState.WindowBytes;
stream.PacketCount += streamState.WindowPackets; stream.PacketCount += streamState.WindowPackets;
if (stream.IsVideoStream) if (stream.IsVideoStream)
{ {
TSStreamDiagnostics diag = new TSStreamDiagnostics(); TSStreamDiagnostics diag = new TSStreamDiagnostics();
@ -457,7 +457,7 @@ namespace BDInfo
int dataSize = 16384; int dataSize = 16384;
Stream fileStream = null; Stream fileStream = null;
try try
{ {
string fileName; string fileName;
if (BDInfoSettings.EnableSSIF && if (BDInfoSettings.EnableSSIF &&
InterleavedFile != null) InterleavedFile != null)
@ -482,13 +482,13 @@ namespace BDInfo
StreamStates.Clear(); StreamStates.Clear();
StreamDiagnostics.Clear(); StreamDiagnostics.Clear();
TSPacketParser parser = TSPacketParser parser =
new TSPacketParser(); new TSPacketParser();
long fileLength = (uint)fileStream.Length; long fileLength = (uint)fileStream.Length;
byte[] buffer = new byte[dataSize]; byte[] buffer = new byte[dataSize];
int bufferLength = 0; int bufferLength = 0;
while ((bufferLength = while ((bufferLength =
fileStream.Read(buffer, 0, buffer.Length)) > 0) fileStream.Read(buffer, 0, buffer.Length)) > 0)
{ {
int offset = 0; int offset = 0;
@ -598,8 +598,8 @@ namespace BDInfo
parser.StreamState.TransferCount++; parser.StreamState.TransferCount++;
bool isFinished = ScanStream( bool isFinished = ScanStream(
parser.Stream, parser.Stream,
parser.StreamState, parser.StreamState,
parser.StreamState.StreamBuffer); parser.StreamState.StreamBuffer);
if (!isFullScan && isFinished) if (!isFullScan && isFinished)
@ -680,10 +680,10 @@ namespace BDInfo
for (int k = 0; k < (parser.PATOffset - 4); k += 4) for (int k = 0; k < (parser.PATOffset - 4); k += 4)
{ {
uint programNumber = (uint) uint programNumber = (uint)
((parser.PAT[k] << 8) + ((parser.PAT[k] << 8) +
parser.PAT[k + 1]); parser.PAT[k + 1]);
ushort programPID = (ushort) ushort programPID = (ushort)
(((parser.PAT[k + 2] & 0x1F) << 8) + (((parser.PAT[k + 2] & 0x1F) << 8) +
parser.PAT[k + 3]); parser.PAT[k + 3]);
@ -985,7 +985,7 @@ namespace BDInfo
parser.PMTProgramDescriptorLength = buffer[i]; parser.PMTProgramDescriptorLength = buffer[i];
parser.PMTProgramDescriptors.Add( parser.PMTProgramDescriptors.Add(
new TSDescriptor( new TSDescriptor(
parser.PMTProgramDescriptor, parser.PMTProgramDescriptor,
parser.PMTProgramDescriptorLength)); parser.PMTProgramDescriptorLength));
break; break;
} }
@ -998,7 +998,7 @@ namespace BDInfo
parser.PMTProgramDescriptors.Count - 1]; parser.PMTProgramDescriptors.Count - 1];
int valueIndex = int valueIndex =
descriptor.Value.Length - descriptor.Value.Length -
parser.PMTProgramDescriptorLength - 1; parser.PMTProgramDescriptorLength - 1;
descriptor.Value[valueIndex] = buffer[i]; descriptor.Value[valueIndex] = buffer[i];
@ -1020,8 +1020,8 @@ namespace BDInfo
parser.SyncState = false; parser.SyncState = false;
} }
} }
else if (parser.Stream != null && else if (parser.Stream != null &&
parser.StreamState != null && parser.StreamState != null &&
parser.TransportScramblingControl == 0) parser.TransportScramblingControl == 0)
{ {
TSStream stream = parser.Stream; TSStream stream = parser.Stream;
@ -1032,7 +1032,7 @@ namespace BDInfo
if (streamState.TransferState) if (streamState.TransferState)
{ {
if ((bufferLength - i) >= streamState.PacketLength && if ((bufferLength - i) >= streamState.PacketLength &&
streamState.PacketLength > 0) streamState.PacketLength > 0)
{ {
offset = streamState.PacketLength; offset = streamState.PacketLength;
@ -1085,7 +1085,7 @@ namespace BDInfo
--parser.PacketLength; --parser.PacketLength;
bool headerFound = false; bool headerFound = false;
if (stream.IsVideoStream && if (stream.IsVideoStream &&
streamState.Parse == 0x000001FD) streamState.Parse == 0x000001FD)
{ {
headerFound = true; headerFound = true;
@ -1170,18 +1170,18 @@ namespace BDInfo
(byte)(streamState.Parse & 0xFF); (byte)(streamState.Parse & 0xFF);
#endif #endif
break; break;
case 1: case 1:
streamState.PESHeaderFlags = streamState.PESHeaderFlags =
(byte)(streamState.Parse & 0xFF); (byte)(streamState.Parse & 0xFF);
#if DEBUG #if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] = streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xFF); (byte)(streamState.Parse & 0xFF);
#endif #endif
break; break;
case 0: case 0:
streamState.PESHeaderLength = streamState.PESHeaderLength =
(byte)(streamState.Parse & 0xFF); (byte)(streamState.Parse & 0xFF);
#if DEBUG #if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] = streamState.PESHeader[streamState.PESHeaderIndex++] =
@ -1211,48 +1211,48 @@ namespace BDInfo
switch (streamState.PTSParse) switch (streamState.PTSParse)
{ {
case 4: case 4:
streamState.PTSTemp = streamState.PTSTemp =
((streamState.Parse & 0xE) << 29); ((streamState.Parse & 0xE) << 29);
#if DEBUG #if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] = streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xff); (byte)(streamState.Parse & 0xff);
#endif #endif
break; break;
case 3: case 3:
streamState.PTSTemp |= streamState.PTSTemp |=
((streamState.Parse & 0xFF) << 22); ((streamState.Parse & 0xFF) << 22);
#if DEBUG #if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] = streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xFF); (byte)(streamState.Parse & 0xFF);
#endif #endif
break; break;
case 2: case 2:
streamState.PTSTemp |= streamState.PTSTemp |=
((streamState.Parse & 0xFE) << 14); ((streamState.Parse & 0xFE) << 14);
#if DEBUG #if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] = streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xFF); (byte)(streamState.Parse & 0xFF);
#endif #endif
break; break;
case 1: case 1:
streamState.PTSTemp |= streamState.PTSTemp |=
((streamState.Parse & 0xFF) << 7); ((streamState.Parse & 0xFF) << 7);
#if DEBUG #if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] = streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xFF); (byte)(streamState.Parse & 0xFF);
#endif #endif
break; break;
case 0: case 0:
streamState.PTSTemp |= streamState.PTSTemp |=
((streamState.Parse & 0xFE) >> 1); ((streamState.Parse & 0xFE) >> 1);
#if DEBUG #if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] = streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xff); (byte)(streamState.Parse & 0xff);
#endif #endif
streamState.PTS = streamState.PTSTemp; streamState.PTS = streamState.PTSTemp;
if (streamState.PTS > streamState.PTSLast) if (streamState.PTS > streamState.PTSLast)
@ -1260,13 +1260,13 @@ namespace BDInfo
if (streamState.PTSLast > 0) if (streamState.PTSLast > 0)
{ {
streamState.PTSTransfer = (streamState.PTS - streamState.PTSLast); streamState.PTSTransfer = (streamState.PTS - streamState.PTSLast);
} }
streamState.PTSLast = streamState.PTS; streamState.PTSLast = streamState.PTS;
} }
streamState.PTSDiff = streamState.PTS - streamState.DTSPrev; streamState.PTSDiff = streamState.PTS - streamState.DTSPrev;
if (streamState.PTSCount > 0 && if (streamState.PTSCount > 0 &&
stream.IsVideoStream) stream.IsVideoStream)
{ {
UpdateStreamBitrates(stream.PID, streamState.PTS, streamState.PTSDiff); UpdateStreamBitrates(stream.PID, streamState.PTS, streamState.PTSDiff);
@ -1280,7 +1280,7 @@ namespace BDInfo
} }
Length = (double)(parser.PTSLast - parser.PTSFirst) / 90000; Length = (double)(parser.PTSLast - parser.PTSFirst) / 90000;
} }
streamState.DTSPrev = streamState.PTS; streamState.DTSPrev = streamState.PTS;
streamState.PTSCount++; streamState.PTSCount++;
if (streamState.PESHeaderLength == 0) if (streamState.PESHeaderLength == 0)
@ -1299,46 +1299,46 @@ namespace BDInfo
switch (streamState.DTSParse) switch (streamState.DTSParse)
{ {
case 9: case 9:
streamState.PTSTemp = streamState.PTSTemp =
((streamState.Parse & 0xE) << 29); ((streamState.Parse & 0xE) << 29);
#if DEBUG #if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] = streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xFF); (byte)(streamState.Parse & 0xFF);
#endif #endif
break; break;
case 8: case 8:
streamState.PTSTemp |= streamState.PTSTemp |=
((streamState.Parse & 0xFF) << 22); ((streamState.Parse & 0xFF) << 22);
#if DEBUG #if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] = streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xFF); (byte)(streamState.Parse & 0xFF);
#endif #endif
break; break;
case 7: case 7:
streamState.PTSTemp |= streamState.PTSTemp |=
((streamState.Parse & 0xFE) << 14); ((streamState.Parse & 0xFE) << 14);
#if DEBUG #if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] = streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xff); (byte)(streamState.Parse & 0xff);
#endif #endif
break; break;
case 6: case 6:
streamState.PTSTemp |= streamState.PTSTemp |=
((streamState.Parse & 0xFF) << 7); ((streamState.Parse & 0xFF) << 7);
#if DEBUG #if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] = streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xFF); (byte)(streamState.Parse & 0xFF);
#endif #endif
break; break;
case 5: case 5:
streamState.PTSTemp |= streamState.PTSTemp |=
((streamState.Parse & 0xFE) >> 1); ((streamState.Parse & 0xFE) >> 1);
#if DEBUG #if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] = streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xff); (byte)(streamState.Parse & 0xff);
#endif #endif
streamState.PTS = streamState.PTSTemp; streamState.PTS = streamState.PTSTemp;
@ -1347,48 +1347,48 @@ namespace BDInfo
streamState.PTSLast = streamState.PTS; streamState.PTSLast = streamState.PTS;
} }
break; break;
case 4: case 4:
streamState.DTSTemp = streamState.DTSTemp =
((streamState.Parse & 0xE) << 29); ((streamState.Parse & 0xE) << 29);
#if DEBUG #if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] = streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xff); (byte)(streamState.Parse & 0xff);
#endif #endif
break; break;
case 3: case 3:
streamState.DTSTemp |= streamState.DTSTemp |=
((streamState.Parse & 0xFF) << 22); ((streamState.Parse & 0xFF) << 22);
#if DEBUG #if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] = streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xff); (byte)(streamState.Parse & 0xff);
#endif #endif
break; break;
case 2: case 2:
streamState.DTSTemp |= streamState.DTSTemp |=
((streamState.Parse & 0xFE) << 14); ((streamState.Parse & 0xFE) << 14);
#if DEBUG #if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] = streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xff); (byte)(streamState.Parse & 0xff);
#endif #endif
break; break;
case 1: case 1:
streamState.DTSTemp |= streamState.DTSTemp |=
((streamState.Parse & 0xFF) << 7); ((streamState.Parse & 0xFF) << 7);
#if DEBUG #if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] = streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xFF); (byte)(streamState.Parse & 0xFF);
#endif #endif
break; break;
case 0: case 0:
streamState.DTSTemp |= streamState.DTSTemp |=
((streamState.Parse & 0xFE) >> 1); ((streamState.Parse & 0xFE) >> 1);
#if DEBUG #if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] = streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xff); (byte)(streamState.Parse & 0xff);
#endif #endif
streamState.PTSDiff = streamState.DTSTemp - streamState.DTSPrev; streamState.PTSDiff = streamState.DTSTemp - streamState.DTSPrev;
@ -1482,8 +1482,8 @@ namespace BDInfo
} }
private TSStream CreateStream( private TSStream CreateStream(
ushort streamPID, ushort streamPID,
byte streamType, byte streamType,
List<TSDescriptor> streamDescriptors) List<TSDescriptor> streamDescriptors)
{ {
TSStream stream = null; TSStream stream = null;
@ -1548,6 +1548,6 @@ namespace BDInfo
} }
return stream; return stream;
} }
} }
} }

View file

@ -11,7 +11,8 @@
- [AnthonyLavado](https://github.com/anthonylavado) - [AnthonyLavado](https://github.com/anthonylavado)
- [sparky8251](https://github.com/sparky8251) - [sparky8251](https://github.com/sparky8251)
- [LeoVerto](https://github.com/LeoVerto) - [LeoVerto](https://github.com/LeoVerto)
- [grafixeyehero](https://github.com/grafixeyehero)
# Emby Contributors # Emby Contributors
- [LukePulverenti](https://github.com/LukePulverenti) - [LukePulverenti](https://github.com/LukePulverenti)

View file

@ -15,7 +15,10 @@ WORKDIR /repo
COPY . . COPY . .
RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \ RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \
&& dotnet clean \ && dotnet clean \
&& dotnet publish --configuration release --output /jellyfin Jellyfin.Server && dotnet publish \
--configuration release \
--output /jellyfin \
Jellyfin.Server
FROM microsoft/dotnet:${DOTNET_VERSION}-runtime FROM microsoft/dotnet:${DOTNET_VERSION}-runtime

View file

@ -7,7 +7,10 @@ COPY . .
RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \ RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \
&& find . -type f -exec sed -i 's/netcoreapp2.1/netcoreapp3.0/g' {} \; \ && find . -type f -exec sed -i 's/netcoreapp2.1/netcoreapp3.0/g' {} \; \
&& dotnet clean \ && dotnet clean \
&& dotnet publish --configuration release --output /jellyfin Jellyfin.Server && dotnet publish \
--configuration release \
--output /jellyfin \
Jellyfin.Server
FROM microsoft/dotnet:${DOTNET_VERSION}-runtime-stretch-slim-arm32v7 FROM microsoft/dotnet:${DOTNET_VERSION}-runtime-stretch-slim-arm32v7
COPY --from=builder /jellyfin /jellyfin COPY --from=builder /jellyfin /jellyfin

View file

@ -1,5 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<Compile Include="..\SharedVersion.cs" Link="SharedVersion.cs" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" /> <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
</ItemGroup> </ItemGroup>

View file

@ -81,7 +81,7 @@ namespace DvdLib.Ifo
private void ReadVTS(ushort vtsNum, List<FileSystemMetadata> allFiles) private void ReadVTS(ushort vtsNum, List<FileSystemMetadata> allFiles)
{ {
var filename = String.Format("VTS_{0:00}_0.IFO", vtsNum); var filename = string.Format("VTS_{0:00}_0.IFO", vtsNum);
var vtsPath = allFiles.FirstOrDefault(i => string.Equals(i.Name, filename, StringComparison.OrdinalIgnoreCase)) ?? var vtsPath = allFiles.FirstOrDefault(i => string.Equals(i.Name, filename, StringComparison.OrdinalIgnoreCase)) ??
allFiles.FirstOrDefault(i => string.Equals(i.Name, Path.ChangeExtension(filename, ".bup"), StringComparison.OrdinalIgnoreCase)); allFiles.FirstOrDefault(i => string.Equals(i.Name, Path.ChangeExtension(filename, ".bup"), StringComparison.OrdinalIgnoreCase));

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -20,7 +20,7 @@ namespace DvdLib.Ifo
else if ((data[3] & 0x40) != 0) FrameRate = 25; else if ((data[3] & 0x40) != 0) FrameRate = 25;
} }
private byte GetBCDValue(byte data) private static byte GetBCDValue(byte data)
{ {
return (byte)((((data & 0xF0) >> 4) * 10) + (data & 0x0F)); return (byte)((((data & 0xF0) >> 4) * 10) + (data & 0x0F));
} }

View file

@ -68,7 +68,7 @@ namespace DvdLib.Ifo
ProhibitedUserOperations = (UserOperation)br.ReadUInt32(); ProhibitedUserOperations = (UserOperation)br.ReadUInt32();
AudioStreamControl = br.ReadBytes(16); AudioStreamControl = br.ReadBytes(16);
SubpictureStreamControl = br.ReadBytes(128); SubpictureStreamControl = br.ReadBytes(128);
_nextProgramNumber = br.ReadUInt16(); _nextProgramNumber = br.ReadUInt16();
_prevProgramNumber = br.ReadUInt16(); _prevProgramNumber = br.ReadUInt16();
_goupProgramNumber = br.ReadUInt16(); _goupProgramNumber = br.ReadUInt16();

View file

@ -20,7 +20,7 @@ namespace DvdLib.Ifo
public ProgramChain EntryProgramChain { get; private set; } public ProgramChain EntryProgramChain { get; private set; }
public readonly List<ProgramChain> ProgramChains; public readonly List<ProgramChain> ProgramChains;
public readonly List<Chapter> Chapters; public readonly List<Chapter> Chapters;
public Title(uint titleNum) public Title(uint titleNum)
{ {

View file

@ -1,29 +1,21 @@
using System.Resources;
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Resources;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("DvdLib")] [assembly: AssemblyTitle("DvdLib")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("Jellyfin Project")]
[assembly: AssemblyProduct("DvdLib")] [assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
[assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")] [assembly: NeutralResourcesLanguage("en")]
// Version information for an assembly consists of the following four values: // 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
// Major Version // COM, set the ComVisible attribute to true on that type.
// Minor Version [assembly: ComVisible(false)]
// 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.1")]

View file

@ -1,6 +1,6 @@
 
namespace Emby.Dlna.Common namespace Emby.Dlna.Common
{ {
public class Argument public class Argument
{ {
public string Name { get; set; } public string Name { get; set; }

View file

@ -1,4 +1,4 @@
using Emby.Dlna.Common; using Emby.Dlna.Common;
using Emby.Dlna.Service; using Emby.Dlna.Service;
using System.Collections.Generic; using System.Collections.Generic;
@ -11,7 +11,7 @@ namespace Emby.Dlna.ConnectionManager
return new ServiceXmlBuilder().GetXml(new ServiceActionListBuilder().GetActions(), GetStateVariables()); return new ServiceXmlBuilder().GetXml(new ServiceActionListBuilder().GetActions(), GetStateVariables());
} }
private IEnumerable<StateVariable> GetStateVariables() private static IEnumerable<StateVariable> GetStateVariables()
{ {
var list = new List<StateVariable>(); var list = new List<StateVariable>();

View file

@ -1,4 +1,4 @@
using Emby.Dlna.Common; using Emby.Dlna.Common;
using System.Collections.Generic; using System.Collections.Generic;
namespace Emby.Dlna.ConnectionManager namespace Emby.Dlna.ConnectionManager
@ -19,7 +19,7 @@ namespace Emby.Dlna.ConnectionManager
return list; return list;
} }
private ServiceAction PrepareForConnection() private static ServiceAction PrepareForConnection()
{ {
var action = new ServiceAction var action = new ServiceAction
{ {
@ -77,8 +77,8 @@ namespace Emby.Dlna.ConnectionManager
return action; return action;
} }
private ServiceAction GetCurrentConnectionInfo() private static ServiceAction GetCurrentConnectionInfo()
{ {
var action = new ServiceAction var action = new ServiceAction
{ {

View file

@ -1,4 +1,4 @@
using Emby.Dlna.Common; using Emby.Dlna.Common;
using Emby.Dlna.Service; using Emby.Dlna.Service;
using System.Collections.Generic; using System.Collections.Generic;
@ -8,11 +8,11 @@ namespace Emby.Dlna.ContentDirectory
{ {
public string GetXml() public string GetXml()
{ {
return new ServiceXmlBuilder().GetXml(new ServiceActionListBuilder().GetActions(), return new ServiceXmlBuilder().GetXml(new ServiceActionListBuilder().GetActions(),
GetStateVariables()); GetStateVariables());
} }
private IEnumerable<StateVariable> GetStateVariables() private static IEnumerable<StateVariable> GetStateVariables()
{ {
var list = new List<StateVariable>(); var list = new List<StateVariable>();

View file

@ -1,4 +1,4 @@
using Emby.Dlna.Common; using Emby.Dlna.Common;
using System.Collections.Generic; using System.Collections.Generic;
namespace Emby.Dlna.ContentDirectory namespace Emby.Dlna.ContentDirectory
@ -20,7 +20,7 @@ namespace Emby.Dlna.ContentDirectory
}; };
} }
private ServiceAction GetGetSystemUpdateIDAction() private static ServiceAction GetGetSystemUpdateIDAction()
{ {
var action = new ServiceAction var action = new ServiceAction
{ {
@ -37,7 +37,7 @@ namespace Emby.Dlna.ContentDirectory
return action; return action;
} }
private ServiceAction GetSearchCapabilitiesAction() private static ServiceAction GetSearchCapabilitiesAction()
{ {
var action = new ServiceAction var action = new ServiceAction
{ {
@ -54,7 +54,7 @@ namespace Emby.Dlna.ContentDirectory
return action; return action;
} }
private ServiceAction GetSortCapabilitiesAction() private static ServiceAction GetSortCapabilitiesAction()
{ {
var action = new ServiceAction var action = new ServiceAction
{ {
@ -71,7 +71,7 @@ namespace Emby.Dlna.ContentDirectory
return action; return action;
} }
private ServiceAction GetX_GetFeatureListAction() private static ServiceAction GetX_GetFeatureListAction()
{ {
var action = new ServiceAction var action = new ServiceAction
{ {
@ -88,7 +88,7 @@ namespace Emby.Dlna.ContentDirectory
return action; return action;
} }
private ServiceAction GetSearchAction() private static ServiceAction GetSearchAction()
{ {
var action = new ServiceAction var action = new ServiceAction
{ {
@ -334,7 +334,7 @@ namespace Emby.Dlna.ContentDirectory
return action; return action;
} }
private ServiceAction GetXSetBookmarkAction() private ServiceAction GetXSetBookmarkAction()
{ {
var action = new ServiceAction var action = new ServiceAction

View file

@ -375,7 +375,7 @@ namespace Emby.Dlna.Didl
? GetMimeType(filename) ? GetMimeType(filename)
: mediaProfile.MimeType; : mediaProfile.MimeType;
writer.WriteAttributeString("protocolInfo", String.Format( writer.WriteAttributeString("protocolInfo", string.Format(
"http-get:*:{0}:{1}", "http-get:*:{0}:{1}",
mimeType, mimeType,
contentFeatures contentFeatures
@ -573,7 +573,7 @@ namespace Emby.Dlna.Didl
streamInfo.RunTimeTicks ?? 0, streamInfo.RunTimeTicks ?? 0,
streamInfo.TranscodeSeekInfo); streamInfo.TranscodeSeekInfo);
writer.WriteAttributeString("protocolInfo", String.Format( writer.WriteAttributeString("protocolInfo", string.Format(
"http-get:*:{0}:{1}", "http-get:*:{0}:{1}",
mimeType, mimeType,
contentFeatures contentFeatures
@ -1017,7 +1017,7 @@ namespace Emby.Dlna.Didl
var contentFeatures = new ContentFeatureBuilder(_profile) var contentFeatures = new ContentFeatureBuilder(_profile)
.BuildImageHeader(format, width, height, imageInfo.IsDirectStream, org_Pn); .BuildImageHeader(format, width, height, imageInfo.IsDirectStream, org_Pn);
writer.WriteAttributeString("protocolInfo", String.Format( writer.WriteAttributeString("protocolInfo", string.Format(
"http-get:*:{0}:{1}", "http-get:*:{0}:{1}",
GetMimeType("file." + format), GetMimeType("file." + format),
contentFeatures contentFeatures

View file

@ -95,7 +95,7 @@ namespace Emby.Dlna
{ {
if (deviceInfo == null) if (deviceInfo == null)
{ {
throw new ArgumentNullException("deviceInfo"); throw new ArgumentNullException(nameof(deviceInfo));
} }
var profile = GetProfiles() var profile = GetProfiles()
@ -207,7 +207,7 @@ namespace Emby.Dlna
{ {
if (headers == null) if (headers == null)
{ {
throw new ArgumentNullException("headers"); throw new ArgumentNullException(nameof(headers));
} }
// Convert to case insensitive // Convert to case insensitive
@ -335,7 +335,7 @@ namespace Emby.Dlna
{ {
if (string.IsNullOrEmpty(id)) if (string.IsNullOrEmpty(id))
{ {
throw new ArgumentNullException("id"); throw new ArgumentNullException(nameof(id));
} }
var info = GetProfileInfosInternal().First(i => string.Equals(i.Info.Id, id, StringComparison.OrdinalIgnoreCase)); var info = GetProfileInfosInternal().First(i => string.Equals(i.Info.Id, id, StringComparison.OrdinalIgnoreCase));

View file

@ -1,5 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<Compile Include="..\SharedVersion.cs" Link="SharedVersion.cs" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" /> <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
<ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" /> <ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />

View file

@ -10,7 +10,7 @@ namespace Emby.Dlna
/// <param name="headers">The headers.</param> /// <param name="headers">The headers.</param>
/// <returns>System.String.</returns> /// <returns>System.String.</returns>
string GetServiceXml(IDictionary<string, string> headers); string GetServiceXml(IDictionary<string, string> headers);
/// <summary> /// <summary>
/// Processes the control request. /// Processes the control request.
/// </summary> /// </summary>

View file

@ -75,11 +75,11 @@ namespace Emby.Dlna.Main
IUserDataManager userDataManager, IUserDataManager userDataManager,
ILocalizationManager localizationManager, ILocalizationManager localizationManager,
IMediaSourceManager mediaSourceManager, IMediaSourceManager mediaSourceManager,
IDeviceDiscovery deviceDiscovery, IDeviceDiscovery deviceDiscovery,
IMediaEncoder mediaEncoder, IMediaEncoder mediaEncoder,
ISocketFactory socketFactory, ISocketFactory socketFactory,
ITimerFactory timerFactory, ITimerFactory timerFactory,
IEnvironmentInfo environmentInfo, IEnvironmentInfo environmentInfo,
INetworkManager networkManager, INetworkManager networkManager,
IUserViewManager userViewManager, IUserViewManager userViewManager,
IXmlReaderSettingsFactory xmlReaderSettingsFactory, IXmlReaderSettingsFactory xmlReaderSettingsFactory,
@ -104,19 +104,19 @@ namespace Emby.Dlna.Main
_networkManager = networkManager; _networkManager = networkManager;
_logger = loggerFactory.CreateLogger("Dlna"); _logger = loggerFactory.CreateLogger("Dlna");
ContentDirectory = new ContentDirectory.ContentDirectory(dlnaManager, ContentDirectory = new ContentDirectory.ContentDirectory(dlnaManager,
userDataManager, userDataManager,
imageProcessor, imageProcessor,
libraryManager, libraryManager,
config, config,
userManager, userManager,
_logger, _logger,
httpClient, httpClient,
localizationManager, localizationManager,
mediaSourceManager, mediaSourceManager,
userViewManager, userViewManager,
mediaEncoder, mediaEncoder,
xmlReaderSettingsFactory, xmlReaderSettingsFactory,
tvSeriesManager); tvSeriesManager);
ConnectionManager = new ConnectionManager.ConnectionManager(dlnaManager, config, _logger, httpClient, xmlReaderSettingsFactory); ConnectionManager = new ConnectionManager.ConnectionManager(dlnaManager, config, _logger, httpClient, xmlReaderSettingsFactory);
@ -271,12 +271,12 @@ namespace Emby.Dlna.Main
var device = new SsdpRootDevice var device = new SsdpRootDevice
{ {
CacheLifetime = TimeSpan.FromSeconds(1800), //How long SSDP clients can cache this info. CacheLifetime = TimeSpan.FromSeconds(1800), //How long SSDP clients can cache this info.
Location = uri, // Must point to the URL that serves your devices UPnP description document. Location = uri, // Must point to the URL that serves your devices UPnP description document.
FriendlyName = "Jellyfin", FriendlyName = "Jellyfin",
Manufacturer = "Jellyfin", Manufacturer = "Jellyfin",
ModelName = "Jellyfin Server", ModelName = "Jellyfin Server",
Uuid = udn Uuid = udn
// This must be a globally unique value that survives reboots etc. Get from storage or embedded hardware etc. // This must be a globally unique value that survives reboots etc. Get from storage or embedded hardware etc.
}; };
SetProperies(device, fullService); SetProperies(device, fullService);
@ -297,7 +297,7 @@ namespace Emby.Dlna.Main
Manufacturer = device.Manufacturer, Manufacturer = device.Manufacturer,
ModelName = device.ModelName, ModelName = device.ModelName,
Uuid = udn Uuid = udn
// This must be a globally unique value that survives reboots etc. Get from storage or embedded hardware etc. // This must be a globally unique value that survives reboots etc. Get from storage or embedded hardware etc.
}; };
SetProperies(embeddedDevice, subDevice); SetProperies(embeddedDevice, subDevice);

View file

@ -1,4 +1,4 @@
using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Configuration;
using Emby.Dlna.Server; using Emby.Dlna.Server;
using Emby.Dlna.Service; using Emby.Dlna.Service;
@ -21,7 +21,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
throw new ResourceNotFoundException("Unexpected control request name: " + methodName); throw new ResourceNotFoundException("Unexpected control request name: " + methodName);
} }
private IEnumerable<KeyValuePair<string, string>> HandleIsAuthorized() private static IEnumerable<KeyValuePair<string, string>> HandleIsAuthorized()
{ {
return new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) return new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
{ {
@ -29,7 +29,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
}; };
} }
private IEnumerable<KeyValuePair<string, string>> HandleIsValidated() private static IEnumerable<KeyValuePair<string, string>> HandleIsValidated()
{ {
return new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) return new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
{ {

View file

@ -1,4 +1,4 @@
using Emby.Dlna.Common; using Emby.Dlna.Common;
using Emby.Dlna.Service; using Emby.Dlna.Service;
using System.Collections.Generic; using System.Collections.Generic;
@ -12,7 +12,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
GetStateVariables()); GetStateVariables());
} }
private IEnumerable<StateVariable> GetStateVariables() private static IEnumerable<StateVariable> GetStateVariables()
{ {
var list = new List<StateVariable>(); var list = new List<StateVariable>();

View file

@ -1,4 +1,4 @@
using Emby.Dlna.Common; using Emby.Dlna.Common;
using System.Collections.Generic; using System.Collections.Generic;
namespace Emby.Dlna.MediaReceiverRegistrar namespace Emby.Dlna.MediaReceiverRegistrar
@ -19,7 +19,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
}; };
} }
private ServiceAction GetIsValidated() private static ServiceAction GetIsValidated()
{ {
var action = new ServiceAction var action = new ServiceAction
{ {
@ -41,7 +41,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
return action; return action;
} }
private ServiceAction GetIsAuthorized() private static ServiceAction GetIsAuthorized()
{ {
var action = new ServiceAction var action = new ServiceAction
{ {
@ -63,7 +63,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
return action; return action;
} }
private ServiceAction GetRegisterDevice() private static ServiceAction GetRegisterDevice()
{ {
var action = new ServiceAction var action = new ServiceAction
{ {
@ -85,7 +85,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
return action; return action;
} }
private ServiceAction GetGetValidationSucceededUpdateID() private static ServiceAction GetGetValidationSucceededUpdateID()
{ {
var action = new ServiceAction var action = new ServiceAction
{ {

View file

@ -311,7 +311,7 @@ namespace Emby.Dlna.PlayTo
throw new InvalidOperationException("Unable to find service"); throw new InvalidOperationException("Unable to find service");
} }
await new SsdpHttpClient(_httpClient, _config).SendCommandAsync(Properties.BaseUrl, service, command.Name, avCommands.BuildPost(command, service.ServiceType, String.Format("{0:hh}:{0:mm}:{0:ss}", value), "REL_TIME")) await new SsdpHttpClient(_httpClient, _config).SendCommandAsync(Properties.BaseUrl, service, command.Name, avCommands.BuildPost(command, service.ServiceType, string.Format("{0:hh}:{0:mm}:{0:ss}", value), "REL_TIME"))
.ConfigureAwait(false); .ConfigureAwait(false);
RestartTimer(true); RestartTimer(true);
@ -364,7 +364,7 @@ namespace Emby.Dlna.PlayTo
private string CreateDidlMeta(string value) private string CreateDidlMeta(string value)
{ {
if (string.IsNullOrEmpty(value)) if (string.IsNullOrEmpty(value))
return String.Empty; return string.Empty;
return DescriptionXmlBuilder.Escape(value); return DescriptionXmlBuilder.Escape(value);
} }
@ -739,7 +739,7 @@ namespace Emby.Dlna.PlayTo
if (track == null) if (track == null)
{ {
//If track is null, some vendors do this, use GetMediaInfo instead //If track is null, some vendors do this, use GetMediaInfo instead
return new Tuple<bool, uBaseObject>(true, null); return new Tuple<bool, uBaseObject>(true, null);
} }
@ -783,7 +783,7 @@ namespace Emby.Dlna.PlayTo
{ {
if (container == null) if (container == null)
{ {
throw new ArgumentNullException("container"); throw new ArgumentNullException(nameof(container));
} }
var url = container.GetValue(uPnpNamespaces.Res); var url = container.GetValue(uPnpNamespaces.Res);
@ -810,7 +810,7 @@ namespace Emby.Dlna.PlayTo
{ {
if (container == null) if (container == null)
{ {
throw new ArgumentNullException("container"); throw new ArgumentNullException(nameof(container));
} }
var resElement = container.Element(uPnpNamespaces.Res); var resElement = container.Element(uPnpNamespaces.Res);
@ -979,7 +979,7 @@ namespace Emby.Dlna.PlayTo
if (modelDescription != null) if (modelDescription != null)
deviceProperties.ModelDescription = modelDescription.Value; deviceProperties.ModelDescription = modelDescription.Value;
deviceProperties.BaseUrl = String.Format("http://{0}:{1}", url.Host, url.Port); deviceProperties.BaseUrl = string.Format("http://{0}:{1}", url.Host, url.Port);
var icon = document.Descendants(uPnpNamespaces.ud.GetName("icon")).FirstOrDefault(); var icon = document.Descendants(uPnpNamespaces.ud.GetName("icon")).FirstOrDefault();
@ -1021,7 +1021,7 @@ namespace Emby.Dlna.PlayTo
{ {
if (element == null) if (element == null)
{ {
throw new ArgumentNullException("element"); throw new ArgumentNullException(nameof(element));
} }
var mimeType = element.GetDescendantValue(uPnpNamespaces.ud.GetName("mimetype")); var mimeType = element.GetDescendantValue(uPnpNamespaces.ud.GetName("mimetype"));
@ -1173,7 +1173,7 @@ namespace Emby.Dlna.PlayTo
public override string ToString() public override string ToString()
{ {
return String.Format("{0} - {1}", Properties.Name, Properties.BaseUrl); return string.Format("{0} - {1}", Properties.Name, Properties.BaseUrl);
} }
} }
} }

View file

@ -114,10 +114,10 @@ namespace Emby.Dlna.PlayTo
info.Headers.TryGetValue("NTS", out nts); info.Headers.TryGetValue("NTS", out nts);
string usn; string usn;
if (!info.Headers.TryGetValue("USN", out usn)) usn = String.Empty; if (!info.Headers.TryGetValue("USN", out usn)) usn = string.Empty;
string nt; string nt;
if (!info.Headers.TryGetValue("NT", out nt)) nt = String.Empty; if (!info.Headers.TryGetValue("NT", out nt)) nt = string.Empty;
if (usn.IndexOf(_device.Properties.UUID, StringComparison.OrdinalIgnoreCase) != -1 && if (usn.IndexOf(_device.Properties.UUID, StringComparison.OrdinalIgnoreCase) != -1 &&
!_disposed) !_disposed)
@ -829,7 +829,7 @@ namespace Emby.Dlna.PlayTo
{ {
if (string.IsNullOrEmpty(url)) if (string.IsNullOrEmpty(url))
{ {
throw new ArgumentNullException("url"); throw new ArgumentNullException(nameof(url));
} }
var parts = url.Split('/'); var parts = url.Split('/');
@ -855,7 +855,7 @@ namespace Emby.Dlna.PlayTo
{ {
if (string.IsNullOrEmpty(url)) if (string.IsNullOrEmpty(url))
{ {
throw new ArgumentNullException("url"); throw new ArgumentNullException(nameof(url));
} }
var request = new StreamParams var request = new StreamParams

View file

@ -1,4 +1,4 @@
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Session; using MediaBrowser.Model.Session;
using System; using System;
@ -49,7 +49,7 @@ namespace Emby.Dlna.PlayTo
return playlistItem; return playlistItem;
} }
private bool IsSupported(DirectPlayProfile profile, Photo item) private static bool IsSupported(DirectPlayProfile profile, Photo item)
{ {
var mediaPath = item.Path; var mediaPath = item.Path;

View file

@ -1,4 +1,4 @@
using MediaBrowser.Common.Net; using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Configuration;
using Emby.Dlna.Common; using Emby.Dlna.Common;
using System; using System;
@ -25,10 +25,10 @@ namespace Emby.Dlna.PlayTo
_config = config; _config = config;
} }
public async Task<XDocument> SendCommandAsync(string baseUrl, public async Task<XDocument> SendCommandAsync(string baseUrl,
DeviceService service, DeviceService service,
string command, string command,
string postData, string postData,
bool logRequest = true, bool logRequest = true,
string header = null) string header = null)
{ {
@ -47,7 +47,7 @@ namespace Emby.Dlna.PlayTo
} }
} }
private string NormalizeServiceUrl(string baseUrl, string serviceUrl) private static string NormalizeServiceUrl(string baseUrl, string serviceUrl)
{ {
// If it's already a complete url, don't stick anything onto the front of it // If it's already a complete url, don't stick anything onto the front of it
if (serviceUrl.StartsWith("http", StringComparison.OrdinalIgnoreCase)) if (serviceUrl.StartsWith("http", StringComparison.OrdinalIgnoreCase))
@ -62,12 +62,12 @@ namespace Emby.Dlna.PlayTo
} }
private readonly CultureInfo _usCulture = new CultureInfo("en-US"); private readonly CultureInfo _usCulture = new CultureInfo("en-US");
public async Task SubscribeAsync(string url, public async Task SubscribeAsync(string url,
string ip, string ip,
int port, int port,
string localIp, string localIp,
int eventport, int eventport,
int timeOut = 3600) int timeOut = 3600)
{ {
var options = new HttpRequestOptions var options = new HttpRequestOptions
@ -121,9 +121,9 @@ namespace Emby.Dlna.PlayTo
} }
} }
private Task<HttpResponseInfo> PostSoapDataAsync(string url, private Task<HttpResponseInfo> PostSoapDataAsync(string url,
string soapAction, string soapAction,
string postData, string postData,
string header, string header,
bool logRequest, bool logRequest,
CancellationToken cancellationToken) CancellationToken cancellationToken)

View file

@ -80,7 +80,7 @@ namespace Emby.Dlna.PlayTo
{ {
if (container == null) if (container == null)
{ {
throw new ArgumentNullException("container"); throw new ArgumentNullException(nameof(container));
} }
return new Argument return new Argument
@ -171,7 +171,7 @@ namespace Emby.Dlna.PlayTo
if (state != null) if (state != null)
{ {
var sendValue = state.AllowedValues.FirstOrDefault(a => string.Equals(a, commandParameter, StringComparison.OrdinalIgnoreCase)) ?? var sendValue = state.AllowedValues.FirstOrDefault(a => string.Equals(a, commandParameter, StringComparison.OrdinalIgnoreCase)) ??
state.AllowedValues.FirstOrDefault() ?? state.AllowedValues.FirstOrDefault() ??
value; value;
return string.Format("<{0} xmlns:dt=\"urn:schemas-microsoft-com:datatypes\" dt:dt=\"{1}\">{2}</{0}>", argument.Name, state.DataType ?? "string", sendValue); return string.Format("<{0} xmlns:dt=\"urn:schemas-microsoft-com:datatypes\" dt:dt=\"{1}\">{2}</{0}>", argument.Name, state.DataType ?? "string", sendValue);

View file

@ -10,7 +10,7 @@ namespace Emby.Dlna.PlayTo
{ {
if (container == null) if (container == null)
{ {
throw new ArgumentNullException("container"); throw new ArgumentNullException(nameof(container));
} }
return new uBaseObject return new uBaseObject

View file

@ -2,7 +2,7 @@
namespace Emby.Dlna.PlayTo namespace Emby.Dlna.PlayTo
{ {
public class uBaseObject public class uBaseObject
{ {
public string Id { get; set; } public string Id { get; set; }
@ -26,7 +26,7 @@ namespace Emby.Dlna.PlayTo
{ {
if (obj == null) if (obj == null)
{ {
throw new ArgumentNullException("obj"); throw new ArgumentNullException(nameof(obj));
} }
return string.Equals(Id, obj.Id); return string.Equals(Id, obj.Id);

View file

@ -20,13 +20,13 @@ namespace Emby.Dlna.PlayTo
if (document == null) if (document == null)
return list; return list;
var item = (from result in document.Descendants("Result") select result).FirstOrDefault(); var item = (from result in document.Descendants("Result") select result).FirstOrDefault();
if (item == null) if (item == null)
return list; return list;
var uPnpResponse = XElement.Parse((String)item); var uPnpResponse = XElement.Parse((string)item);
var uObjects = from container in uPnpResponse.Elements(uPnpNamespaces.containers) var uObjects = from container in uPnpResponse.Elements(uPnpNamespaces.containers)
select new uParserObject { Element = container }; select new uParserObject { Element = container };

View file

@ -41,7 +41,7 @@ namespace Emby.Dlna.Profiles
EnableSingleAlbumArtLimit = true; EnableSingleAlbumArtLimit = true;
EnableAlbumArtInDidl = true; EnableAlbumArtInDidl = true;
TranscodingProfiles = new[] TranscodingProfiles = new[]
{ {
new TranscodingProfile new TranscodingProfile

View file

@ -1,17 +1,16 @@
using System.Resources; using System.Resources;
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("Emby.Dlna2")] [assembly: AssemblyTitle("Emby.Dlna")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("Jellyfin Project")]
[assembly: AssemblyProduct("Emby.Dlna2")] [assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
[assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")] [assembly: NeutralResourcesLanguage("en")]
@ -19,12 +18,10 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values: // Version information for an assembly consists of the following four values:
// //
// Major Version // Major Version
// Minor Version // Minor Version
// Build Number // Build Number
// Revision // Revision
// //
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View file

@ -1,4 +1,4 @@
using Emby.Dlna.Common; using Emby.Dlna.Common;
using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Extensions; using MediaBrowser.Model.Extensions;
using System; using System;
@ -24,12 +24,12 @@ namespace Emby.Dlna.Server
{ {
if (string.IsNullOrEmpty(serverUdn)) if (string.IsNullOrEmpty(serverUdn))
{ {
throw new ArgumentNullException("serverUdn"); throw new ArgumentNullException(nameof(serverUdn));
} }
if (string.IsNullOrEmpty(serverAddress)) if (string.IsNullOrEmpty(serverAddress))
{ {
throw new ArgumentNullException("serverAddress"); throw new ArgumentNullException(nameof(serverAddress));
} }
_profile = profile; _profile = profile;
@ -39,10 +39,7 @@ namespace Emby.Dlna.Server
_serverId = serverId; _serverId = serverId;
} }
private bool EnableAbsoluteUrls private static bool EnableAbsoluteUrls => false;
{
get { return false; }
}
public string GetXml() public string GetXml()
{ {

View file

@ -14,7 +14,7 @@ namespace Emby.Dlna.Service
protected BaseService(ILogger logger, IHttpClient httpClient) protected BaseService(ILogger logger, IHttpClient httpClient)
{ {
Logger = logger; Logger = logger;
HttpClient = httpClient; HttpClient = httpClient;
EventManager = new EventManager(Logger, HttpClient); EventManager = new EventManager(Logger, HttpClient);
} }

View file

@ -10,7 +10,7 @@ namespace Emby.Dlna.Service
public class ControlErrorHandler public class ControlErrorHandler
{ {
private const string NS_SOAPENV = "http://schemas.xmlsoap.org/soap/envelope/"; private const string NS_SOAPENV = "http://schemas.xmlsoap.org/soap/envelope/";
public ControlResponse GetResponse(Exception ex) public ControlResponse GetResponse(Exception ex)
{ {
var settings = new XmlWriterSettings var settings = new XmlWriterSettings

View file

@ -1,4 +1,4 @@
using Emby.Dlna.Common; using Emby.Dlna.Common;
using System.Collections.Generic; using System.Collections.Generic;
using System.Security; using System.Security;
using System.Text; using System.Text;
@ -28,7 +28,7 @@ namespace Emby.Dlna.Service
return builder.ToString(); return builder.ToString();
} }
private void AppendActionList(StringBuilder builder, IEnumerable<ServiceAction> actions) private static void AppendActionList(StringBuilder builder, IEnumerable<ServiceAction> actions)
{ {
builder.Append("<actionList>"); builder.Append("<actionList>");
@ -59,7 +59,7 @@ namespace Emby.Dlna.Service
builder.Append("</actionList>"); builder.Append("</actionList>");
} }
private void AppendServiceStateTable(StringBuilder builder, IEnumerable<StateVariable> stateVariables) private static void AppendServiceStateTable(StringBuilder builder, IEnumerable<StateVariable> stateVariables)
{ {
builder.Append("<serviceStateTable>"); builder.Append("<serviceStateTable>");

View file

@ -83,8 +83,8 @@ namespace Emby.Dlna.Ssdp
{ {
_deviceLocator = new SsdpDeviceLocator(_commsServer, _timerFactory); _deviceLocator = new SsdpDeviceLocator(_commsServer, _timerFactory);
// (Optional) Set the filter so we only see notifications for devices we care about // (Optional) Set the filter so we only see notifications for devices we care about
// (can be any search target value i.e device type, uuid value etc - any value that appears in the // (can be any search target value i.e device type, uuid value etc - any value that appears in the
// DiscoverdSsdpDevice.NotificationType property or that is used with the searchTarget parameter of the Search method). // DiscoverdSsdpDevice.NotificationType property or that is used with the searchTarget parameter of the Search method).
//_DeviceLocator.NotificationFilter = "upnp:rootdevice"; //_DeviceLocator.NotificationFilter = "upnp:rootdevice";

View file

@ -1,25 +1,21 @@
using System.Resources;
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Resources;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("Emby.Drawing.Skia")] [assembly: AssemblyTitle("Emby.Drawing.Skia")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("Jellyfin Project")]
[assembly: AssemblyProduct("Emby.Drawing.Skia")] [assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
[assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")] [assembly: NeutralResourcesLanguage("en")]
// Version information for an assembly consists of the following four values: // 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
// Major Version // COM, set the ComVisible attribute to true on that type.
// Minor Version [assembly: ComVisible(false)]
// Build Number
// Revision
//

View file

@ -197,7 +197,7 @@ namespace Emby.Drawing.Skia
private static bool HasDiacritics(string text) private static bool HasDiacritics(string text)
{ {
return !String.Equals(text, text.RemoveDiacritics(), StringComparison.Ordinal); return !string.Equals(text, text.RemoveDiacritics(), StringComparison.Ordinal);
} }
private static bool RequiresSpecialCharacterHack(string path) private static bool RequiresSpecialCharacterHack(string path)
@ -509,11 +509,11 @@ namespace Emby.Drawing.Skia
{ {
if (string.IsNullOrWhiteSpace(inputPath)) if (string.IsNullOrWhiteSpace(inputPath))
{ {
throw new ArgumentNullException("inputPath"); throw new ArgumentNullException(nameof(inputPath));
} }
if (string.IsNullOrWhiteSpace(inputPath)) if (string.IsNullOrWhiteSpace(inputPath))
{ {
throw new ArgumentNullException("outputPath"); throw new ArgumentNullException(nameof(outputPath));
} }
var skiaOutputFormat = GetImageFormat(selectedOutputFormat); var skiaOutputFormat = GetImageFormat(selectedOutputFormat);
@ -594,12 +594,12 @@ namespace Emby.Drawing.Skia
// If foreground layer present then draw // If foreground layer present then draw
if (hasForegroundColor) if (hasForegroundColor)
{ {
if (!Double.TryParse(options.ForegroundLayer, out double opacity)) if (!double.TryParse(options.ForegroundLayer, out double opacity))
{ {
opacity = .4; opacity = .4;
} }
canvas.DrawColor(new SKColor(0, 0, 0, (Byte)((1 - opacity) * 0xFF)), SKBlendMode.SrcOver); canvas.DrawColor(new SKColor(0, 0, 0, (byte)((1 - opacity) * 0xFF)), SKBlendMode.SrcOver);
} }
if (hasIndicator) if (hasIndicator)

View file

@ -1,4 +1,4 @@
using SkiaSharp; using SkiaSharp;
using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Configuration;
using System; using System;
using System.IO; using System.IO;
@ -20,6 +20,11 @@ namespace Emby.Drawing.Skia
public static SKEncodedImageFormat GetEncodedFormat(string outputPath) public static SKEncodedImageFormat GetEncodedFormat(string outputPath)
{ {
if (outputPath == null)
{
throw new ArgumentNullException(nameof(outputPath));
}
var ext = Path.GetExtension(outputPath).ToLower(); var ext = Path.GetExtension(outputPath).ToLower();
if (ext == ".jpg" || ext == ".jpeg") if (ext == ".jpg" || ext == ".jpeg")

View file

@ -50,12 +50,13 @@ namespace Emby.Drawing.Common
/// <exception cref="ArgumentException">The image was of an unrecognised format.</exception> /// <exception cref="ArgumentException">The image was of an unrecognised format.</exception>
public static ImageSize GetDimensions(string path, ILogger logger, IFileSystem fileSystem) public static ImageSize GetDimensions(string path, ILogger logger, IFileSystem fileSystem)
{ {
var extension = Path.GetExtension(path); if (string.IsNullOrEmpty(path))
if (string.IsNullOrEmpty(extension))
{ {
throw new ArgumentException("ImageHeader doesn't support image file"); throw new ArgumentNullException(nameof(path));
} }
string extension = Path.GetExtension(path).ToLower();
if (!SupportedExtensions.Contains(extension)) if (!SupportedExtensions.Contains(extension))
{ {
throw new ArgumentException("ImageHeader doesn't support " + extension); throw new ArgumentException("ImageHeader doesn't support " + extension);
@ -94,7 +95,7 @@ namespace Emby.Drawing.Common
} }
} }
throw new ArgumentException(ErrorMessage, "binaryReader"); throw new ArgumentException(ErrorMessage, nameof(binaryReader));
} }
/// <summary> /// <summary>

View file

@ -80,7 +80,7 @@ namespace Emby.Drawing
{ {
if (value == null) if (value == null)
{ {
throw new ArgumentNullException("value"); throw new ArgumentNullException(nameof(value));
} }
_imageEncoder = value; _imageEncoder = value;
@ -103,7 +103,7 @@ namespace Emby.Drawing
"crw", "crw",
// Remove until supported // Remove until supported
//"nef", //"nef",
"orf", "orf",
"pef", "pef",
"arw", "arw",
@ -179,7 +179,7 @@ namespace Emby.Drawing
{ {
if (options == null) if (options == null)
{ {
throw new ArgumentNullException("options"); throw new ArgumentNullException(nameof(options));
} }
var originalImage = options.Image; var originalImage = options.Image;
@ -491,7 +491,7 @@ namespace Emby.Drawing
{ {
if (string.IsNullOrEmpty(path)) if (string.IsNullOrEmpty(path))
{ {
throw new ArgumentNullException("path"); throw new ArgumentNullException(nameof(path));
} }
try try
@ -691,12 +691,12 @@ namespace Emby.Drawing
{ {
if (string.IsNullOrEmpty(originalImagePath)) if (string.IsNullOrEmpty(originalImagePath))
{ {
throw new ArgumentNullException("originalImagePath"); throw new ArgumentNullException(nameof(originalImagePath));
} }
if (item == null) if (item == null)
{ {
throw new ArgumentNullException("item"); throw new ArgumentNullException(nameof(item));
} }
var treatmentRequiresTransparency = false; var treatmentRequiresTransparency = false;
@ -779,16 +779,16 @@ namespace Emby.Drawing
{ {
if (string.IsNullOrEmpty(path)) if (string.IsNullOrEmpty(path))
{ {
throw new ArgumentNullException("path"); throw new ArgumentNullException(nameof(path));
} }
if (string.IsNullOrEmpty(uniqueName)) if (string.IsNullOrEmpty(uniqueName))
{ {
throw new ArgumentNullException("uniqueName"); throw new ArgumentNullException(nameof(uniqueName));
} }
if (string.IsNullOrEmpty(fileExtension)) if (string.IsNullOrEmpty(fileExtension))
{ {
throw new ArgumentNullException("fileExtension"); throw new ArgumentNullException(nameof(fileExtension));
} }
var filename = uniqueName.GetMD5() + fileExtension; var filename = uniqueName.GetMD5() + fileExtension;
@ -811,11 +811,11 @@ namespace Emby.Drawing
{ {
if (string.IsNullOrEmpty(path)) if (string.IsNullOrEmpty(path))
{ {
throw new ArgumentNullException("path"); throw new ArgumentNullException(nameof(path));
} }
if (string.IsNullOrEmpty(filename)) if (string.IsNullOrEmpty(filename))
{ {
throw new ArgumentNullException("filename"); throw new ArgumentNullException(nameof(filename));
} }
var prefix = filename.Substring(0, 1); var prefix = filename.Substring(0, 1);

View file

@ -1,20 +1,20 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("Emby.Drawing")] [assembly: AssemblyTitle("Emby.Drawing")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("Jellyfin Project")]
[assembly: AssemblyProduct("Emby.Drawing")] [assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
[assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible // 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 // to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type. // COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
@ -24,7 +24,7 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values: // Version information for an assembly consists of the following four values:
// //
// Major Version // Major Version
// Minor Version // Minor Version
// Build Number // Build Number
// Revision // Revision
// //

View file

@ -1,5 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<Compile Include="..\..\SharedVersion.cs" Link="SharedVersion.cs" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\MediaBrowser.Model\MediaBrowser.Model.csproj" /> <ProjectReference Include="..\..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
<ProjectReference Include="..\..\MediaBrowser.Common\MediaBrowser.Common.csproj" /> <ProjectReference Include="..\..\MediaBrowser.Common\MediaBrowser.Common.csproj" />

View file

@ -87,7 +87,7 @@ namespace IsoMounter
UmountCommand UmountCommand
); );
if (!String.IsNullOrEmpty(SudoCommand) && !String.IsNullOrEmpty(MountCommand) && !String.IsNullOrEmpty(UmountCommand)) { if (!string.IsNullOrEmpty(SudoCommand) && !string.IsNullOrEmpty(MountCommand) && !string.IsNullOrEmpty(UmountCommand)) {
ExecutablesAvailable = true; ExecutablesAvailable = true;
} else { } else {
ExecutablesAvailable = false; ExecutablesAvailable = false;
@ -152,7 +152,7 @@ namespace IsoMounter
return Task.FromResult<IIsoMount>(mountedISO); return Task.FromResult<IIsoMount>(mountedISO);
} }
else { else {
throw new IOException(String.Format( throw new IOException(string.Format(
"An error occurred trying to mount image [$0].", "An error occurred trying to mount image [$0].",
isoPath isoPath
)); ));
@ -217,7 +217,7 @@ namespace IsoMounter
{ {
string path = test.Trim(); string path = test.Trim();
if (!String.IsNullOrEmpty(path) && FileSystem.FileExists(path = Path.Combine(path, name))) { if (!string.IsNullOrEmpty(path) && FileSystem.FileExists(path = Path.Combine(path, name))) {
return FileSystem.GetFullPath(path); return FileSystem.GetFullPath(path);
} }
} }

View file

@ -48,7 +48,7 @@ namespace IsoMounter
if (disposed) { if (disposed) {
return; return;
} }
if (disposing) { if (disposing) {
// //

View file

@ -0,0 +1,21 @@
using System.Reflection;
using System.Resources;
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("IsoMounter")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// 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)]

View file

@ -29,7 +29,7 @@ namespace Emby.Naming.AudioBook
/// </summary> /// </summary>
/// <value>The alternate versions.</value> /// <value>The alternate versions.</value>
public List<AudioBookFileInfo> AlternateVersions { get; set; } public List<AudioBookFileInfo> AlternateVersions { get; set; }
public AudioBookInfo() public AudioBookInfo()
{ {
Files = new List<AudioBookFileInfo>(); Files = new List<AudioBookFileInfo>();

View file

@ -30,7 +30,7 @@ namespace Emby.Naming.AudioBook
{ {
if (string.IsNullOrEmpty(path)) if (string.IsNullOrEmpty(path))
{ {
throw new ArgumentNullException("path"); throw new ArgumentNullException(nameof(path));
} }
if (IsDirectory) if (IsDirectory)
return null; return null;
@ -46,7 +46,7 @@ namespace Emby.Naming.AudioBook
var parsingResult = new AudioBookFilePathParser(_options) var parsingResult = new AudioBookFilePathParser(_options)
.Parse(path, IsDirectory); .Parse(path, IsDirectory);
return new AudioBookFileInfo return new AudioBookFileInfo
{ {
Path = path, Path = path,

View file

@ -282,7 +282,7 @@ namespace Emby.Naming.Common
new EpisodeExpression(@".*(\\|\/)(?<seriesname>((?![Ss]([0-9]+)[][ ._-]*[Ee]([0-9]+))[^\\\/])*)?[Ss](?<seasonnumber>[0-9]+)[][ ._-]*[Ee](?<epnumber>[0-9]+)([^\\/]*)$") new EpisodeExpression(@".*(\\|\/)(?<seriesname>((?![Ss]([0-9]+)[][ ._-]*[Ee]([0-9]+))[^\\\/])*)?[Ss](?<seasonnumber>[0-9]+)[][ ._-]*[Ee](?<epnumber>[0-9]+)([^\\/]*)$")
{ {
IsNamed = true IsNamed = true
}, },
// <!-- foo.ep01, foo.EP_01 --> // <!-- foo.ep01, foo.EP_01 -->
new EpisodeExpression(@"[\._ -]()[Ee][Pp]_?([0-9]+)([^\\/]*)$"), new EpisodeExpression(@"[\._ -]()[Ee][Pp]_?([0-9]+)([^\\/]*)$"),
new EpisodeExpression("([0-9]{4})[\\.-]([0-9]{2})[\\.-]([0-9]{2})", true) new EpisodeExpression("([0-9]{4})[\\.-]([0-9]{2})[\\.-]([0-9]{2})", true)

View file

@ -4,6 +4,10 @@
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Compile Include="..\SharedVersion.cs" Link="SharedVersion.cs" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj" /> <ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj" />

View file

@ -0,0 +1,21 @@
using System.Reflection;
using System.Resources;
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.Naming")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// 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)]

View file

@ -18,7 +18,7 @@ namespace Emby.Naming.Subtitles
{ {
if (string.IsNullOrEmpty(path)) if (string.IsNullOrEmpty(path))
{ {
throw new ArgumentNullException("path"); throw new ArgumentNullException(nameof(path));
} }
var extension = Path.GetExtension(path); var extension = Path.GetExtension(path);
@ -52,7 +52,7 @@ namespace Emby.Naming.Subtitles
{ {
if (string.IsNullOrEmpty(path)) if (string.IsNullOrEmpty(path))
{ {
throw new ArgumentNullException("path"); throw new ArgumentNullException(nameof(path));
} }
// Note: the tags need be be surrounded be either a space ( ), hyphen -, dot . or underscore _. // Note: the tags need be be surrounded be either a space ( ), hyphen -, dot . or underscore _.

View file

@ -1,4 +1,4 @@
using Emby.Naming.Common; using Emby.Naming.Common;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
@ -74,7 +74,7 @@ namespace Emby.Naming.TV
return result ?? new EpisodePathParserResult(); return result ?? new EpisodePathParserResult();
} }
private EpisodePathParserResult Parse(string name, EpisodeExpression expression) private static EpisodePathParserResult Parse(string name, EpisodeExpression expression)
{ {
var result = new EpisodePathParserResult(); var result = new EpisodePathParserResult();

View file

@ -19,7 +19,7 @@ namespace Emby.Naming.TV
{ {
if (string.IsNullOrEmpty(path)) if (string.IsNullOrEmpty(path))
{ {
throw new ArgumentNullException("path"); throw new ArgumentNullException(nameof(path));
} }
var isStub = false; var isStub = false;
@ -53,7 +53,7 @@ namespace Emby.Naming.TV
var parsingResult = new EpisodePathParser(_options) var parsingResult = new EpisodePathParser(_options)
.Parse(path, IsDirectory, isNamed, isOptimistic, supportsAbsoluteNumbers, fillExtendedInfo); .Parse(path, IsDirectory, isNamed, isOptimistic, supportsAbsoluteNumbers, fillExtendedInfo);
return new EpisodeInfo return new EpisodeInfo
{ {
Path = path, Path = path,

View file

@ -1,4 +1,4 @@
using System; using System;
using Emby.Naming.Common; using Emby.Naming.Common;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
@ -38,7 +38,7 @@ namespace Emby.Naming.Video
} }
catch (ArgumentException) catch (ArgumentException)
{ {
} }
var result = _options.CleanDateTimeRegexes.Select(i => Clean(name, i)) var result = _options.CleanDateTimeRegexes.Select(i => Clean(name, i))
@ -63,7 +63,7 @@ namespace Emby.Naming.Video
result; result;
} }
private CleanDateTimeResult Clean(string name, Regex expression) private static CleanDateTimeResult Clean(string name, Regex expression)
{ {
var result = new CleanDateTimeResult(); var result = new CleanDateTimeResult();

View file

@ -1,4 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace Emby.Naming.Video namespace Emby.Naming.Video
@ -30,7 +30,7 @@ namespace Emby.Naming.Video
}; };
} }
private CleanStringResult Clean(string name, Regex expression) private static CleanStringResult Clean(string name, Regex expression)
{ {
var result = new CleanStringResult(); var result = new CleanStringResult();

View file

@ -22,7 +22,7 @@ namespace Emby.Naming.Video
{ {
if (string.IsNullOrEmpty(path)) if (string.IsNullOrEmpty(path))
{ {
throw new ArgumentNullException("path"); throw new ArgumentNullException(nameof(path));
} }
// Note: the tags need be be surrounded be either a space ( ), hyphen -, dot . or underscore _. // Note: the tags need be be surrounded be either a space ( ), hyphen -, dot . or underscore _.

View file

@ -1,4 +1,4 @@
using Emby.Naming.Common; using Emby.Naming.Common;
using System; using System;
using System.Linq; using System.Linq;
@ -36,7 +36,7 @@ namespace Emby.Naming.Video
return new Format3DResult(); return new Format3DResult();
} }
private Format3DResult Parse(string[] videoFlags, Format3DRule rule) private static Format3DResult Parse(string[] videoFlags, Format3DRule rule)
{ {
var result = new Format3DResult(); var result = new Format3DResult();

View file

@ -126,7 +126,7 @@ namespace Emby.Naming.Video
} }
stack.Files.Add(file2.FullName); stack.Files.Add(file2.FullName);
} }
else else
{ {
// Sequel // Sequel
offset = 0; offset = 0;

View file

@ -18,7 +18,7 @@ namespace Emby.Naming.Video
{ {
var result = new StubResult(); var result = new StubResult();
var extension = Path.GetExtension(path) ?? string.Empty; var extension = Path.GetExtension(path) ?? string.Empty;
if (_options.StubFileExtensions.Contains(extension, StringComparer.OrdinalIgnoreCase)) if (_options.StubFileExtensions.Contains(extension, StringComparer.OrdinalIgnoreCase))
{ {
result.IsStub = true; result.IsStub = true;

View file

@ -55,7 +55,7 @@ namespace Emby.Naming.Video
/// Gets or sets the type of the stub. /// Gets or sets the type of the stub.
/// </summary> /// </summary>
/// <value>The type of the stub.</value> /// <value>The type of the stub.</value>
public string StubType { get; set; } public string StubType { get; set; }
/// <summary> /// <summary>
/// Gets or sets the type. /// Gets or sets the type.
/// </summary> /// </summary>

View file

@ -32,7 +32,7 @@ namespace Emby.Naming.Video
/// </summary> /// </summary>
/// <value>The alternate versions.</value> /// <value>The alternate versions.</value>
public List<VideoFileInfo> AlternateVersions { get; set; } public List<VideoFileInfo> AlternateVersions { get; set; }
public VideoInfo() public VideoInfo()
{ {
Files = new List<VideoFileInfo>(); Files = new List<VideoFileInfo>();

View file

@ -1,4 +1,4 @@
using Emby.Naming.Common; using Emby.Naming.Common;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@ -55,9 +55,9 @@ namespace Emby.Naming.Video
info.Year = info.Files.First().Year; info.Year = info.Files.First().Year;
var extraBaseNames = new List<string> var extraBaseNames = new List<string>
{ {
stack.Name, stack.Name,
Path.GetFileNameWithoutExtension(stack.Files[0]) Path.GetFileNameWithoutExtension(stack.Files[0])
}; };
@ -236,7 +236,7 @@ namespace Emby.Naming.Video
if (testFilename.StartsWith(folderName, StringComparison.OrdinalIgnoreCase)) if (testFilename.StartsWith(folderName, StringComparison.OrdinalIgnoreCase))
{ {
testFilename = testFilename.Substring(folderName.Length).Trim(); testFilename = testFilename.Substring(folderName.Length).Trim();
return testFilename.StartsWith("-", StringComparison.OrdinalIgnoreCase)||Regex.Replace(testFilename, @"\[([^]]*)\]", "").Trim() == String.Empty; return testFilename.StartsWith("-", StringComparison.OrdinalIgnoreCase) || Regex.Replace(testFilename, @"\[([^]]*)\]", "").Trim() == string.Empty;
} }
return false; return false;

View file

@ -45,7 +45,7 @@ namespace Emby.Naming.Video
{ {
if (string.IsNullOrEmpty(path)) if (string.IsNullOrEmpty(path))
{ {
throw new ArgumentNullException("path"); throw new ArgumentNullException(nameof(path));
} }
var isStub = false; var isStub = false;

View file

@ -5,6 +5,10 @@
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Compile Include="..\SharedVersion.cs" Link="SharedVersion.cs" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" /> <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
<ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" /> <ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />

View file

@ -1,5 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Resources;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
@ -8,29 +8,14 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Emby.Notifications")] [assembly: AssemblyTitle("Emby.Notifications")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("Jellyfin Project")]
[assembly: AssemblyProduct("Emby.Notifications")] [assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
[assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// Setting ComVisible to false makes the types in this assembly not visible // 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 // to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type. // COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4d1d313b-60bb-4e11-acf9-cda6745266ef")]
// 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")]

View file

@ -1,34 +1,21 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Resources;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("Emby.Photos")] [assembly: AssemblyTitle("Emby.Photos")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("Jellyfin Project")]
[assembly: AssemblyProduct("Emby.Photos")] [assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
[assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// Setting ComVisible to false makes the types in this assembly not visible // 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 // to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type. // COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)] [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.*")]

View file

@ -202,7 +202,7 @@ namespace Emby.Server.Implementations.Activity
return name; return name;
} }
private string GetPlaybackNotificationType(string mediaType) private static string GetPlaybackNotificationType(string mediaType)
{ {
if (string.Equals(mediaType, MediaType.Audio, StringComparison.OrdinalIgnoreCase)) if (string.Equals(mediaType, MediaType.Audio, StringComparison.OrdinalIgnoreCase))
{ {
@ -220,7 +220,7 @@ namespace Emby.Server.Implementations.Activity
return null; return null;
} }
private string GetPlaybackStoppedNotificationType(string mediaType) private static string GetPlaybackStoppedNotificationType(string mediaType)
{ {
if (string.Equals(mediaType, MediaType.Audio, StringComparison.OrdinalIgnoreCase)) if (string.Equals(mediaType, MediaType.Audio, StringComparison.OrdinalIgnoreCase))
{ {
@ -577,8 +577,8 @@ namespace Emby.Server.Implementations.Activity
/// <param name="description">The name of this item (singular form)</param> /// <param name="description">The name of this item (singular form)</param>
private static string CreateValueString(int value, string description) private static string CreateValueString(int value, string description)
{ {
return String.Format("{0:#,##0} {1}", return string.Format("{0:#,##0} {1}",
value, value == 1 ? description : String.Format("{0}s", description)); value, value == 1 ? description : string.Format("{0}s", description));
} }
} }
} }

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
@ -83,7 +83,7 @@ namespace Emby.Server.Implementations.Activity
{ {
if (entry == null) if (entry == null)
{ {
throw new ArgumentNullException("entry"); throw new ArgumentNullException(nameof(entry));
} }
using (WriteLock.Write()) using (WriteLock.Write())
@ -122,7 +122,7 @@ namespace Emby.Server.Implementations.Activity
{ {
if (entry == null) if (entry == null)
{ {
throw new ArgumentNullException("entry"); throw new ArgumentNullException(nameof(entry));
} }
using (WriteLock.Write()) using (WriteLock.Write())
@ -251,7 +251,7 @@ namespace Emby.Server.Implementations.Activity
} }
} }
private ActivityLogEntry GetEntry(IReadOnlyList<IResultSetValue> reader) private static ActivityLogEntry GetEntry(IReadOnlyList<IResultSetValue> reader)
{ {
var index = 0; var index = 0;

View file

@ -55,61 +55,31 @@ namespace Emby.Server.Implementations.AppBase
} }
private const string _virtualDataPath = "%AppDataPath%"; private const string _virtualDataPath = "%AppDataPath%";
public string VirtualDataPath public string VirtualDataPath => _virtualDataPath;
{
get
{
return _virtualDataPath;
}
}
/// <summary> /// <summary>
/// Gets the image cache path. /// Gets the image cache path.
/// </summary> /// </summary>
/// <value>The image cache path.</value> /// <value>The image cache path.</value>
public string ImageCachePath public string ImageCachePath => Path.Combine(CachePath, "images");
{
get
{
return Path.Combine(CachePath, "images");
}
}
/// <summary> /// <summary>
/// Gets the path to the plugin directory /// Gets the path to the plugin directory
/// </summary> /// </summary>
/// <value>The plugins path.</value> /// <value>The plugins path.</value>
public string PluginsPath public string PluginsPath => Path.Combine(ProgramDataPath, "plugins");
{
get
{
return Path.Combine(ProgramDataPath, "plugins");
}
}
/// <summary> /// <summary>
/// Gets the path to the plugin configurations directory /// Gets the path to the plugin configurations directory
/// </summary> /// </summary>
/// <value>The plugin configurations path.</value> /// <value>The plugin configurations path.</value>
public string PluginConfigurationsPath public string PluginConfigurationsPath => Path.Combine(PluginsPath, "configurations");
{
get
{
return Path.Combine(PluginsPath, "configurations");
}
}
/// <summary> /// <summary>
/// Gets the path to where temporary update files will be stored /// Gets the path to where temporary update files will be stored
/// </summary> /// </summary>
/// <value>The plugin configurations path.</value> /// <value>The plugin configurations path.</value>
public string TempUpdatePath public string TempUpdatePath => Path.Combine(ProgramDataPath, "updates");
{
get
{
return Path.Combine(ProgramDataPath, "updates");
}
}
/// <summary> /// <summary>
/// The _log directory /// The _log directory
@ -133,10 +103,7 @@ namespace Emby.Server.Implementations.AppBase
return _logDirectoryPath; return _logDirectoryPath;
} }
set set => _logDirectoryPath = value;
{
_logDirectoryPath = value;
}
} }
/// <summary> /// <summary>
@ -161,23 +128,14 @@ namespace Emby.Server.Implementations.AppBase
return _configurationDirectoryPath; return _configurationDirectoryPath;
} }
set set => _configurationDirectoryPath = value;
{
_configurationDirectoryPath = value;
}
} }
/// <summary> /// <summary>
/// Gets the path to the system configuration file /// Gets the path to the system configuration file
/// </summary> /// </summary>
/// <value>The system configuration file path.</value> /// <value>The system configuration file path.</value>
public string SystemConfigurationFilePath public string SystemConfigurationFilePath => Path.Combine(ConfigurationDirectoryPath, "system.xml");
{
get
{
return Path.Combine(ConfigurationDirectoryPath, "system.xml");
}
}
/// <summary> /// <summary>
/// The _cache directory /// The _cache directory
@ -200,22 +158,13 @@ namespace Emby.Server.Implementations.AppBase
return _cachePath; return _cachePath;
} }
set set => _cachePath = value;
{
_cachePath = value;
}
} }
/// <summary> /// <summary>
/// Gets the folder path to the temp directory within the cache folder /// Gets the folder path to the temp directory within the cache folder
/// </summary> /// </summary>
/// <value>The temp directory.</value> /// <value>The temp directory.</value>
public string TempDirectory public string TempDirectory => Path.Combine(CachePath, "temp");
{
get
{
return Path.Combine(CachePath, "temp");
}
}
} }
} }

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@ -99,6 +99,7 @@ namespace Emby.Server.Implementations.AppBase
/// <param name="applicationPaths">The application paths.</param> /// <param name="applicationPaths">The application paths.</param>
/// <param name="loggerFactory">The logger factory.</param> /// <param name="loggerFactory">The logger factory.</param>
/// <param name="xmlSerializer">The XML serializer.</param> /// <param name="xmlSerializer">The XML serializer.</param>
/// <param name="fileSystem">The file system</param>
protected BaseConfigurationManager(IApplicationPaths applicationPaths, ILoggerFactory loggerFactory, IXmlSerializer xmlSerializer, IFileSystem fileSystem) protected BaseConfigurationManager(IApplicationPaths applicationPaths, ILoggerFactory loggerFactory, IXmlSerializer xmlSerializer, IFileSystem fileSystem)
{ {
CommonApplicationPaths = applicationPaths; CommonApplicationPaths = applicationPaths;
@ -155,7 +156,7 @@ namespace Emby.Server.Implementations.AppBase
{ {
if (newConfiguration == null) if (newConfiguration == null)
{ {
throw new ArgumentNullException("newConfiguration"); throw new ArgumentNullException(nameof(newConfiguration));
} }
ValidateCachePath(newConfiguration); ValidateCachePath(newConfiguration);

View file

@ -1,4 +1,4 @@
using System; using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
@ -18,6 +18,7 @@ namespace Emby.Server.Implementations.AppBase
/// <param name="type">The type.</param> /// <param name="type">The type.</param>
/// <param name="path">The path.</param> /// <param name="path">The path.</param>
/// <param name="xmlSerializer">The XML serializer.</param> /// <param name="xmlSerializer">The XML serializer.</param>
/// <param name="fileSystem">The file system</param>
/// <returns>System.Object.</returns> /// <returns>System.Object.</returns>
public static object GetXmlConfiguration(Type type, string path, IXmlSerializer xmlSerializer, IFileSystem fileSystem) public static object GetXmlConfiguration(Type type, string path, IXmlSerializer xmlSerializer, IFileSystem fileSystem)
{ {

View file

@ -1,4 +1,4 @@
using Emby.Common.Implementations.Serialization; using Emby.Common.Implementations.Serialization;
using Emby.Drawing; using Emby.Drawing;
using Emby.Photos; using Emby.Photos;
using Emby.Dlna; using Emby.Dlna;
@ -132,13 +132,7 @@ namespace Emby.Server.Implementations
/// Gets or sets a value indicating whether this instance can self update. /// Gets or sets a value indicating whether this instance can self update.
/// </summary> /// </summary>
/// <value><c>true</c> if this instance can self update; otherwise, <c>false</c>.</value> /// <value><c>true</c> if this instance can self update; otherwise, <c>false</c>.</value>
public virtual bool CanSelfUpdate public virtual bool CanSelfUpdate => false;
{
get
{
return false;
}
}
public virtual bool CanLaunchWebBrowser public virtual bool CanLaunchWebBrowser
{ {
@ -245,10 +239,7 @@ namespace Emby.Server.Implementations
} }
} }
public virtual string OperatingSystemDisplayName public virtual string OperatingSystemDisplayName => EnvironmentInfo.OperatingSystemName;
{
get { return EnvironmentInfo.OperatingSystemName; }
}
/// <summary> /// <summary>
/// The container /// The container
@ -261,10 +252,7 @@ namespace Emby.Server.Implementations
/// Gets the server configuration manager. /// Gets the server configuration manager.
/// </summary> /// </summary>
/// <value>The server configuration manager.</value> /// <value>The server configuration manager.</value>
public IServerConfigurationManager ServerConfigurationManager public IServerConfigurationManager ServerConfigurationManager => (IServerConfigurationManager)ConfigurationManager;
{
get { return (IServerConfigurationManager)ConfigurationManager; }
}
/// <summary> /// <summary>
/// Gets the configuration manager. /// Gets the configuration manager.
@ -453,13 +441,7 @@ namespace Emby.Server.Implementations
/// Gets the current application version /// Gets the current application version
/// </summary> /// </summary>
/// <value>The application version.</value> /// <value>The application version.</value>
public Version ApplicationVersion public Version ApplicationVersion => _version ?? (_version = typeof(ApplicationHost).Assembly.GetName().Version);
{
get
{
return _version ?? (_version = typeof(ApplicationHost).Assembly.GetName().Version);
}
}
private DeviceId _deviceId; private DeviceId _deviceId;
public string SystemId public string SystemId
@ -479,15 +461,9 @@ namespace Emby.Server.Implementations
/// Gets the name. /// Gets the name.
/// </summary> /// </summary>
/// <value>The name.</value> /// <value>The name.</value>
public string Name public string Name => "Emby Server";
{
get
{
return "Emby Server";
}
}
private Tuple<Assembly, string> GetAssembly(Type type) private static Tuple<Assembly, string> GetAssembly(Type type)
{ {
var assembly = type.GetTypeInfo().Assembly; var assembly = type.GetTypeInfo().Assembly;
string path = null; string path = null;
@ -513,7 +489,7 @@ namespace Emby.Server.Implementations
/// <summary> /// <summary>
/// Creates the instance safe. /// Creates the instance safe.
/// </summary> /// </summary>
/// <param name="type">The type.</param> /// <param name="typeInfo">The type information.</param>
/// <returns>System.Object.</returns> /// <returns>System.Object.</returns>
protected object CreateInstanceSafe(Tuple<Type, string> typeInfo) protected object CreateInstanceSafe(Tuple<Type, string> typeInfo)
{ {
@ -1004,13 +980,7 @@ namespace Emby.Server.Implementations
return s => JsvReader.GetParseFn(propertyType)(s); return s => JsvReader.GetParseFn(propertyType)(s);
} }
public virtual string PackageRuntime public virtual string PackageRuntime => "netcore";
{
get
{
return "netcore";
}
}
public static void LogEnvironmentInfo(ILogger logger, IApplicationPaths appPaths, EnvironmentInfo.EnvironmentInfo environmentInfo) public static void LogEnvironmentInfo(ILogger logger, IApplicationPaths appPaths, EnvironmentInfo.EnvironmentInfo environmentInfo)
{ {
@ -1049,7 +1019,7 @@ namespace Emby.Server.Implementations
return name + "/" + ApplicationVersion; return name + "/" + ApplicationVersion;
} }
private string FormatAttribute(string str) private static string FormatAttribute(string str)
{ {
var arr = str.ToCharArray(); var arr = str.ToCharArray();
@ -1066,13 +1036,7 @@ namespace Emby.Server.Implementations
return result; return result;
} }
protected virtual bool SupportsDualModeSockets protected virtual bool SupportsDualModeSockets => true;
{
get
{
return true;
}
}
private X509Certificate GetCertificate(CertificateInfo info) private X509Certificate GetCertificate(CertificateInfo info)
{ {
@ -1927,18 +1891,9 @@ namespace Emby.Server.Implementations
}; };
} }
public bool EnableHttps public bool EnableHttps => SupportsHttps && ServerConfigurationManager.Configuration.EnableHttps;
{
get
{
return SupportsHttps && ServerConfigurationManager.Configuration.EnableHttps;
}
}
public bool SupportsHttps public bool SupportsHttps => Certificate != null || ServerConfigurationManager.Configuration.IsBehindProxy;
{
get { return Certificate != null || ServerConfigurationManager.Configuration.IsBehindProxy; }
}
public async Task<string> GetLocalApiUrl(CancellationToken cancellationToken) public async Task<string> GetLocalApiUrl(CancellationToken cancellationToken)
{ {
@ -2132,15 +2087,10 @@ namespace Emby.Server.Implementations
} }
} }
public string FriendlyName public string FriendlyName =>
{ string.IsNullOrEmpty(ServerConfigurationManager.Configuration.ServerName)
get ? Environment.MachineName
{ : ServerConfigurationManager.Configuration.ServerName;
return string.IsNullOrEmpty(ServerConfigurationManager.Configuration.ServerName)
? Environment.MachineName
: ServerConfigurationManager.Configuration.ServerName;
}
}
public int HttpPort { get; private set; } public int HttpPort { get; private set; }
@ -2177,7 +2127,7 @@ namespace Emby.Server.Implementations
private bool _hasUpdateAvailable; private bool _hasUpdateAvailable;
public bool HasUpdateAvailable public bool HasUpdateAvailable
{ {
get { return _hasUpdateAvailable; } get => _hasUpdateAvailable;
set set
{ {
var fireEvent = value && !_hasUpdateAvailable; var fireEvent = value && !_hasUpdateAvailable;

View file

@ -15,14 +15,14 @@ namespace Emby.Server.Implementations.Archiving
/// </summary> /// </summary>
public class ZipClient : IZipClient public class ZipClient : IZipClient
{ {
private readonly IFileSystem _fileSystem; private readonly IFileSystem _fileSystem;
public ZipClient(IFileSystem fileSystem) public ZipClient(IFileSystem fileSystem)
{ {
_fileSystem = fileSystem; _fileSystem = fileSystem;
} }
/// <summary> /// <summary>
/// Extracts all. /// Extracts all.
/// </summary> /// </summary>
/// <param name="sourceFile">The source file.</param> /// <param name="sourceFile">The source file.</param>
@ -30,7 +30,7 @@ namespace Emby.Server.Implementations.Archiving
/// <param name="overwriteExistingFiles">if set to <c>true</c> [overwrite existing files].</param> /// <param name="overwriteExistingFiles">if set to <c>true</c> [overwrite existing files].</param>
public void ExtractAll(string sourceFile, string targetPath, bool overwriteExistingFiles) public void ExtractAll(string sourceFile, string targetPath, bool overwriteExistingFiles)
{ {
using (var fileStream = _fileSystem.OpenRead(sourceFile)) using (var fileStream = _fileSystem.OpenRead(sourceFile))
{ {
ExtractAll(fileStream, targetPath, overwriteExistingFiles); ExtractAll(fileStream, targetPath, overwriteExistingFiles);
} }
@ -116,7 +116,7 @@ namespace Emby.Server.Implementations.Archiving
/// <param name="overwriteExistingFiles">if set to <c>true</c> [overwrite existing files].</param> /// <param name="overwriteExistingFiles">if set to <c>true</c> [overwrite existing files].</param>
public void ExtractAllFrom7z(string sourceFile, string targetPath, bool overwriteExistingFiles) public void ExtractAllFrom7z(string sourceFile, string targetPath, bool overwriteExistingFiles)
{ {
using (var fileStream = _fileSystem.OpenRead(sourceFile)) using (var fileStream = _fileSystem.OpenRead(sourceFile))
{ {
ExtractAllFrom7z(fileStream, targetPath, overwriteExistingFiles); ExtractAllFrom7z(fileStream, targetPath, overwriteExistingFiles);
} }
@ -156,7 +156,7 @@ namespace Emby.Server.Implementations.Archiving
/// <param name="overwriteExistingFiles">if set to <c>true</c> [overwrite existing files].</param> /// <param name="overwriteExistingFiles">if set to <c>true</c> [overwrite existing files].</param>
public void ExtractAllFromTar(string sourceFile, string targetPath, bool overwriteExistingFiles) public void ExtractAllFromTar(string sourceFile, string targetPath, bool overwriteExistingFiles)
{ {
using (var fileStream = _fileSystem.OpenRead(sourceFile)) using (var fileStream = _fileSystem.OpenRead(sourceFile))
{ {
ExtractAllFromTar(fileStream, targetPath, overwriteExistingFiles); ExtractAllFromTar(fileStream, targetPath, overwriteExistingFiles);
} }

View file

@ -41,7 +41,7 @@ namespace Emby.Server.Implementations.Browser
} }
catch (NotSupportedException) catch (NotSupportedException)
{ {
} }
catch (Exception) catch (Exception)
{ {

View file

@ -30,10 +30,7 @@ namespace Emby.Server.Implementations.Channels
return channel.GetChannelImage(type, cancellationToken); return channel.GetChannelImage(type, cancellationToken);
} }
public string Name public string Name => "Channel Image Provider";
{
get { return "Channel Image Provider"; }
}
public bool Supports(BaseItem item) public bool Supports(BaseItem item)
{ {

View file

@ -1,4 +1,4 @@
using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net; using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Channels; using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Configuration;
@ -67,13 +67,7 @@ namespace Emby.Server.Implementations.Channels
_providerManager = providerManager; _providerManager = providerManager;
} }
private TimeSpan CacheLength private static TimeSpan CacheLength => TimeSpan.FromHours(3);
{
get
{
return TimeSpan.FromHours(3);
}
}
public void AddParts(IEnumerable<IChannel> channels) public void AddParts(IEnumerable<IChannel> channels)
{ {
@ -269,6 +263,7 @@ namespace Emby.Server.Implementations.Channels
{ {
}; };
//TODO Fix The co-variant conversion (internalResult.Items) between Folder[] and BaseItem[], this can generate runtime issues.
var returnItems = _dtoService.GetBaseItemDtos(internalResult.Items, dtoOptions, user); var returnItems = _dtoService.GetBaseItemDtos(internalResult.Items, dtoOptions, user);
var result = new QueryResult<BaseItemDto> var result = new QueryResult<BaseItemDto>
@ -419,7 +414,7 @@ namespace Emby.Server.Implementations.Channels
return list; return list;
} }
private MediaSourceInfo NormalizeMediaSource(BaseItem item, MediaSourceInfo info) private static MediaSourceInfo NormalizeMediaSource(BaseItem item, MediaSourceInfo info)
{ {
info.RunTimeTicks = info.RunTimeTicks ?? item.RunTimeTicks; info.RunTimeTicks = info.RunTimeTicks ?? item.RunTimeTicks;
@ -492,7 +487,7 @@ namespace Emby.Server.Implementations.Channels
return item; return item;
} }
private string GetOfficialRating(ChannelParentalRating rating) private static string GetOfficialRating(ChannelParentalRating rating)
{ {
switch (rating) switch (rating)
{ {
@ -533,7 +528,7 @@ namespace Emby.Server.Implementations.Channels
{ {
if (string.IsNullOrEmpty(id)) if (string.IsNullOrEmpty(id))
{ {
throw new ArgumentNullException("id"); throw new ArgumentNullException(nameof(id));
} }
var channel = GetChannel(id); var channel = GetChannel(id);
@ -577,7 +572,7 @@ namespace Emby.Server.Implementations.Channels
{ {
if (string.IsNullOrEmpty(name)) if (string.IsNullOrEmpty(name))
{ {
throw new ArgumentNullException("name"); throw new ArgumentNullException(nameof(name));
} }
return _libraryManager.GetNewItemId("Channel " + name, typeof(Channel)); return _libraryManager.GetNewItemId("Channel " + name, typeof(Channel));
} }
@ -891,7 +886,7 @@ namespace Emby.Server.Implementations.Channels
filename + ".json"); filename + ".json");
} }
private string GetIdToHash(string externalId, string channelName) private static string GetIdToHash(string externalId, string channelName)
{ {
// Increment this as needed to force new downloads // Increment this as needed to force new downloads
// Incorporate Name because it's being used to convert channel entity to provider // Incorporate Name because it's being used to convert channel entity to provider
@ -902,7 +897,7 @@ namespace Emby.Server.Implementations.Channels
where T : BaseItem, new() where T : BaseItem, new()
{ {
var id = _libraryManager.GetNewItemId(GetIdToHash(idString, channelName), typeof(T)); var id = _libraryManager.GetNewItemId(GetIdToHash(idString, channelName), typeof(T));
T item = null; T item = null;
try try
@ -1187,7 +1182,7 @@ namespace Emby.Server.Implementations.Channels
{ {
if (channel == null) if (channel == null)
{ {
throw new ArgumentNullException("channel"); throw new ArgumentNullException(nameof(channel));
} }
var result = GetAllChannels() var result = GetAllChannels()

View file

@ -25,35 +25,17 @@ namespace Emby.Server.Implementations.Channels
_libraryManager = libraryManager; _libraryManager = libraryManager;
} }
public string Name public string Name => "Refresh Channels";
{
get { return "Refresh Channels"; }
}
public string Description public string Description => "Refreshes internet channel information.";
{
get { return "Refreshes internet channel information."; }
}
public string Category public string Category => "Internet Channels";
{
get { return "Internet Channels"; }
}
public bool IsHidden public bool IsHidden => ((ChannelManager)_channelManager).Channels.Length == 0;
{
get { return ((ChannelManager)_channelManager).Channels.Length == 0; }
}
public bool IsEnabled public bool IsEnabled => true;
{
get { return true; }
}
public bool IsLogged public bool IsLogged => true;
{
get { return true; }
}
public async Task Execute(CancellationToken cancellationToken, IProgress<double> progress) public async Task Execute(CancellationToken cancellationToken, IProgress<double> progress)
{ {
@ -70,16 +52,13 @@ namespace Emby.Server.Implementations.Channels
/// </summary> /// </summary>
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers() public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
{ {
return new[] { return new[] {
// Every so often // Every so often
new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(24).Ticks} new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(24).Ticks}
}; };
} }
public string Key public string Key => "RefreshInternetChannels";
{
get { return "RefreshInternetChannels"; }
}
} }
} }

View file

@ -38,28 +38,19 @@ namespace Emby.Server.Implementations.Configuration
/// Gets the type of the configuration. /// Gets the type of the configuration.
/// </summary> /// </summary>
/// <value>The type of the configuration.</value> /// <value>The type of the configuration.</value>
protected override Type ConfigurationType protected override Type ConfigurationType => typeof(ServerConfiguration);
{
get { return typeof(ServerConfiguration); }
}
/// <summary> /// <summary>
/// Gets the application paths. /// Gets the application paths.
/// </summary> /// </summary>
/// <value>The application paths.</value> /// <value>The application paths.</value>
public IServerApplicationPaths ApplicationPaths public IServerApplicationPaths ApplicationPaths => (IServerApplicationPaths)CommonApplicationPaths;
{
get { return (IServerApplicationPaths)CommonApplicationPaths; }
}
/// <summary> /// <summary>
/// Gets the configuration. /// Gets the configuration.
/// </summary> /// </summary>
/// <value>The configuration.</value> /// <value>The configuration.</value>
public ServerConfiguration Configuration public ServerConfiguration Configuration => (ServerConfiguration)CommonConfiguration;
{
get { return (ServerConfiguration)CommonConfiguration; }
}
/// <summary> /// <summary>
/// Called when [configuration updated]. /// Called when [configuration updated].

View file

@ -24,15 +24,9 @@ namespace Emby.Server.Implementations.Data
WriteLock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion); WriteLock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion);
} }
protected TransactionMode TransactionMode protected TransactionMode TransactionMode => TransactionMode.Deferred;
{
get { return TransactionMode.Deferred; }
}
protected TransactionMode ReadTransactionMode protected TransactionMode ReadTransactionMode => TransactionMode.Deferred;
{
get { return TransactionMode.Deferred; }
}
internal static int ThreadSafeMode { get; set; } internal static int ThreadSafeMode { get; set; }
@ -58,10 +52,7 @@ namespace Emby.Server.Implementations.Data
private string _defaultWal; private string _defaultWal;
protected ManagedConnection _connection; protected ManagedConnection _connection;
protected virtual bool EnableSingleConnection protected virtual bool EnableSingleConnection => true;
{
get { return true; }
}
protected ManagedConnection CreateConnection(bool isReadOnly = false) protected ManagedConnection CreateConnection(bool isReadOnly = false)
{ {
@ -238,21 +229,9 @@ namespace Emby.Server.Implementations.Data
Logger.LogInformation("PRAGMA synchronous=" + db.Query("PRAGMA synchronous").SelectScalarString().First()); Logger.LogInformation("PRAGMA synchronous=" + db.Query("PRAGMA synchronous").SelectScalarString().First());
} }
protected virtual bool EnableTempStoreMemory protected virtual bool EnableTempStoreMemory => false;
{
get
{
return false;
}
}
protected virtual int? CacheSize protected virtual int? CacheSize => null;
{
get
{
return null;
}
}
internal static void CheckOk(int rc) internal static void CheckOk(int rc)
{ {
@ -276,7 +255,7 @@ namespace Emby.Server.Implementations.Data
{ {
if (_disposed) if (_disposed)
{ {
throw new ObjectDisposedException(GetType().Name + " has been disposed and cannot be accessed."); throw new ObjectDisposedException(GetType().Name ,"Object has been disposed and cannot be accessed.");
} }
} }

View file

@ -32,13 +32,7 @@ namespace Emby.Server.Implementations.Data
/// Gets the name of the repository /// Gets the name of the repository
/// </summary> /// </summary>
/// <value>The name.</value> /// <value>The name.</value>
public string Name public string Name => "SQLite";
{
get
{
return "SQLite";
}
}
/// <summary> /// <summary>
/// The _json serializer /// The _json serializer
@ -94,11 +88,11 @@ namespace Emby.Server.Implementations.Data
{ {
if (displayPreferences == null) if (displayPreferences == null)
{ {
throw new ArgumentNullException("displayPreferences"); throw new ArgumentNullException(nameof(displayPreferences));
} }
if (string.IsNullOrEmpty(displayPreferences.Id)) if (string.IsNullOrEmpty(displayPreferences.Id))
{ {
throw new ArgumentNullException("displayPreferences.Id"); throw new ArgumentNullException(nameof(displayPreferences.Id));
} }
cancellationToken.ThrowIfCancellationRequested(); cancellationToken.ThrowIfCancellationRequested();
@ -142,7 +136,7 @@ namespace Emby.Server.Implementations.Data
{ {
if (displayPreferences == null) if (displayPreferences == null)
{ {
throw new ArgumentNullException("displayPreferences"); throw new ArgumentNullException(nameof(displayPreferences));
} }
cancellationToken.ThrowIfCancellationRequested(); cancellationToken.ThrowIfCancellationRequested();
@ -174,7 +168,7 @@ namespace Emby.Server.Implementations.Data
{ {
if (string.IsNullOrEmpty(displayPreferencesId)) if (string.IsNullOrEmpty(displayPreferencesId))
{ {
throw new ArgumentNullException("displayPreferencesId"); throw new ArgumentNullException(nameof(displayPreferencesId));
} }
var guidId = displayPreferencesId.GetMD5(); var guidId = displayPreferencesId.GetMD5();

View file

@ -14,7 +14,7 @@ namespace Emby.Server.Implementations.Data
{ {
if (queries == null) if (queries == null)
{ {
throw new ArgumentNullException("queries"); throw new ArgumentNullException(nameof(queries));
} }
connection.RunInTransaction(conn => connection.RunInTransaction(conn =>
@ -134,7 +134,7 @@ namespace Emby.Server.Implementations.Data
{ {
if (obj == null) if (obj == null)
{ {
throw new ArgumentNullException("obj"); throw new ArgumentNullException(nameof(obj));
} }
using (var stream = new MemoryStream()) using (var stream = new MemoryStream())

Some files were not shown because too many files have changed in this diff Show more