Skip to content

Commit

Permalink
fix case sensitive file names
Browse files Browse the repository at this point in the history
  • Loading branch information
LukePulverenti committed Oct 9, 2014
1 parent b187168 commit 8020036
Show file tree
Hide file tree
Showing 38 changed files with 212 additions and 72 deletions.
7 changes: 7 additions & 0 deletions MediaBrowser.Api/Playback/BaseStreamingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1387,6 +1387,13 @@ private void ParseParams(StreamRequest request)
videoRequest.MaxVideoBitDepth = int.Parse(val, UsCulture);
}
}
else if (i == 19)
{
if (videoRequest != null)
{
videoRequest.Profile = val;
}
}
}
}

Expand Down
29 changes: 29 additions & 0 deletions MediaBrowser.Controller/Library/MetadataConfigurationStore.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using MediaBrowser.Common.Configuration;
using MediaBrowser.Model.Configuration;
using System.Collections.Generic;

namespace MediaBrowser.Controller.Library
{
public class MetadataConfigurationStore : IConfigurationFactory
{
public IEnumerable<ConfigurationStore> GetConfigurations()
{
return new List<ConfigurationStore>
{
new ConfigurationStore
{
Key = "metadata",
ConfigurationType = typeof(MetadataConfiguration)
}
};
}
}

public static class MetadataConfigurationExtensions
{
public static MetadataConfiguration GetMetadataConfiguration(this IConfigurationManager config)
{
return config.GetConfiguration<MetadataConfiguration>("metadata");
}
}
}
1 change: 1 addition & 0 deletions MediaBrowser.Controller/MediaBrowser.Controller.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
<Compile Include="Library\IUserDataManager.cs" />
<Compile Include="Library\IUserViewManager.cs" />
<Compile Include="Library\LibraryManagerExtensions.cs" />
<Compile Include="Library\MetadataConfigurationStore.cs" />
<Compile Include="Library\PlaybackStopEventArgs.cs" />
<Compile Include="Library\UserDataSaveEventArgs.cs" />
<Compile Include="LiveTv\RecordingGroup.cs" />
Expand Down
20 changes: 17 additions & 3 deletions MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public static void EnsureDates(IFileSystem fileSystem, BaseItem item, ItemResolv
{
if (includeCreationTime)
{
item.DateCreated = DateTime.UtcNow;
SetDateCreated(item, fileSystem, childData);
}

item.DateModified = fileSystem.GetLastWriteTimeUtc(childData);
Expand All @@ -224,7 +224,7 @@ public static void EnsureDates(IFileSystem fileSystem, BaseItem item, ItemResolv
{
if (includeCreationTime)
{
item.DateCreated = DateTime.UtcNow;
SetDateCreated(item, fileSystem, fileData);
}
item.DateModified = fileSystem.GetLastWriteTimeUtc(fileData);
}
Expand All @@ -234,10 +234,24 @@ public static void EnsureDates(IFileSystem fileSystem, BaseItem item, ItemResolv
{
if (includeCreationTime)
{
item.DateCreated = DateTime.UtcNow;
SetDateCreated(item, fileSystem, args.FileInfo);
}
item.DateModified = fileSystem.GetLastWriteTimeUtc(args.FileInfo);
}
}

private static void SetDateCreated(BaseItem item, IFileSystem fileSystem, FileSystemInfo info)
{
var config = BaseItem.ConfigurationManager.GetMetadataConfiguration();

if (config.UseFileCreationTimeForDateAdded)
{
item.DateModified = fileSystem.GetCreationTimeUtc(info);
}
else
{
item.DateCreated = DateTime.UtcNow;
}
}
}
}
3 changes: 3 additions & 0 deletions MediaBrowser.MediaInfo/MediaBrowser.MediaInfo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SharedVersion.cs">
<Link>Properties\SharedVersion.cs</Link>
</Compile>
<Compile Include="MediaInfoLib.cs" />
<Compile Include="Native.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
7 changes: 1 addition & 6 deletions MediaBrowser.MediaInfo/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,4 @@
// 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")]
//
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@
<Compile Include="..\MediaBrowser.Model\Configuration\ImageSavingConvention.cs">
<Link>Configuration\ImageSavingConvention.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\Configuration\MetadataConfiguration.cs">
<Link>Configuration\MetadataConfiguration.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\Configuration\MetadataOptions.cs">
<Link>Configuration\MetadataOptions.cs</Link>
</Compile>
Expand Down
3 changes: 3 additions & 0 deletions MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@
<Compile Include="..\MediaBrowser.Model\Configuration\ImageSavingConvention.cs">
<Link>Configuration\ImageSavingConvention.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\Configuration\MetadataConfiguration.cs">
<Link>Configuration\MetadataConfiguration.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\Configuration\MetadataOptions.cs">
<Link>Configuration\MetadataOptions.cs</Link>
</Compile>
Expand Down
3 changes: 3 additions & 0 deletions MediaBrowser.Model/Configuration/CinemaModeConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ public class CinemaModeConfiguration
public bool EnableIntrosFromUpcomingDvdMovies { get; set; }
public bool EnableIntrosFromUpcomingStreamingMovies { get; set; }

public int TrailerLimit { get; set; }

public CinemaModeConfiguration()
{
EnableIntrosParentalControl = true;
TrailerLimit = 2;
}
}
}
8 changes: 8 additions & 0 deletions MediaBrowser.Model/Configuration/MetadataConfiguration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

namespace MediaBrowser.Model.Configuration
{
public class MetadataConfiguration
{
public bool UseFileCreationTimeForDateAdded { get; set; }
}
}
16 changes: 8 additions & 8 deletions MediaBrowser.Model/Configuration/ServerConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.FileOrganization;
using MediaBrowser.Model.LiveTv;

namespace MediaBrowser.Model.Configuration
{
Expand All @@ -15,6 +13,12 @@ public class ServerConfiguration : BaseApplicationConfiguration
/// <value><c>true</c> if [enable u pn p]; otherwise, <c>false</c>.</value>
public bool EnableUPnP { get; set; }

/// <summary>
/// Gets or sets the public mapped port.
/// </summary>
/// <value>The public mapped port.</value>
public int PublicPort { get; set; }

/// <summary>
/// Gets or sets the HTTP server port number.
/// </summary>
Expand Down Expand Up @@ -167,20 +171,15 @@ public class ServerConfiguration : BaseApplicationConfiguration

public string UICulture { get; set; }

public DlnaOptions DlnaOptions { get; set; }

public double DownMixAudioBoost { get; set; }

public bool DefaultMetadataSettingsApplied { get; set; }

public PeopleMetadataOptions PeopleMetadataOptions { get; set; }
public bool FindInternetTrailers { get; set; }

public string[] InsecureApps { get; set; }

public bool SaveMetadataHidden { get; set; }

public bool FindInternetTrailers { get; set; }

/// <summary>
/// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
/// </summary>
Expand All @@ -189,6 +188,7 @@ public ServerConfiguration()
{
MediaEncodingQuality = EncodingQuality.Auto;
ImageSavingConvention = ImageSavingConvention.Compatible;
PublicPort = 8096;
HttpServerPortNumber = 8096;
EnableDashboardResponseCaching = true;

Expand Down
6 changes: 4 additions & 2 deletions MediaBrowser.Model/Dlna/ConditionProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,10 @@ private bool IsConditionSatisfied(ProfileCondition condition, string currentValu

switch (condition.Condition)
{
case ProfileConditionType.SubstringOf:
return StringHelper.IndexOfIgnoreCase(currentValue, expected) != -1;
case ProfileConditionType.EqualsAny:
{
return ListHelper.ContainsIgnoreCase(expected.Split('|'), currentValue);
}
case ProfileConditionType.Equals:
return StringHelper.EqualsIgnoreCase(currentValue, expected);
case ProfileConditionType.NotEquals:
Expand Down
2 changes: 1 addition & 1 deletion MediaBrowser.Model/Dlna/ProfileConditionType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ public enum ProfileConditionType
NotEquals = 1,
LessThanEqual = 2,
GreaterThanEqual = 3,
SubstringOf = 4
EqualsAny = 4
}
}
6 changes: 3 additions & 3 deletions MediaBrowser.Model/Dlna/Profiles/AndroidProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public AndroidProfile(bool supportsHls, bool supportsMpegDash)
VideoCodec = "h264",
AudioCodec = "aac",
Type = DlnaProfileType.Video,
VideoProfile = "Baseline",
VideoProfile = "baseline",
Context = EncodingContext.Streaming
});
}
Expand All @@ -42,7 +42,7 @@ public AndroidProfile(bool supportsHls, bool supportsMpegDash)
VideoCodec = "h264",
AudioCodec = "aac",
Type = DlnaProfileType.Video,
VideoProfile = "Baseline",
VideoProfile = "baseline",
Context = EncodingContext.Static
});

Expand Down Expand Up @@ -102,7 +102,7 @@ public AndroidProfile(bool supportsHls, bool supportsMpegDash)

Conditions = new []
{
new ProfileCondition(ProfileConditionType.SubstringOf, ProfileConditionValue.VideoProfile, "baseline"),
new ProfileCondition(ProfileConditionType.EqualsAny, ProfileConditionValue.VideoProfile, "baseline|constrained baseline"),
new ProfileCondition(ProfileConditionType.LessThanEqual, ProfileConditionValue.Width, "1920"),
new ProfileCondition(ProfileConditionType.LessThanEqual, ProfileConditionValue.Height, "1080"),
new ProfileCondition(ProfileConditionType.LessThanEqual, ProfileConditionValue.VideoBitDepth, "8"),
Expand Down
1 change: 1 addition & 0 deletions MediaBrowser.Model/Dlna/StreamBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ private StreamInfo BuildVideoItem(MediaSourceInfo item, VideoOptions options)
playlistItem.VideoCodec = transcodingProfile.VideoCodec;
playlistItem.Protocol = transcodingProfile.Protocol;
playlistItem.AudioStreamIndex = audioStreamIndex;
playlistItem.VideoProfile = transcodingProfile.VideoProfile;

List<ProfileCondition> videoTranscodingConditions = new List<ProfileCondition>();
foreach (CodecProfile i in options.Profile.CodecProfiles)
Expand Down
1 change: 1 addition & 0 deletions MediaBrowser.Model/Dlna/StreamInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ private static string BuildDlnaParam(StreamInfo item)
list.Add(item.IsDirectStream ? string.Empty : DateTime.UtcNow.Ticks.ToString(CultureInfo.InvariantCulture));
list.Add(item.MaxRefFrames.HasValue ? StringHelper.ToStringCultureInvariant(item.MaxRefFrames.Value) : string.Empty);
list.Add(item.MaxVideoBitDepth.HasValue ? StringHelper.ToStringCultureInvariant(item.MaxVideoBitDepth.Value) : string.Empty);
list.Add(item.VideoProfile ?? string.Empty);

return string.Format("Params={0}", string.Join(";", list.ToArray()));
}
Expand Down
1 change: 1 addition & 0 deletions MediaBrowser.Model/MediaBrowser.Model.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
<Compile Include="Configuration\ChannelOptions.cs" />
<Compile Include="Configuration\ChapterOptions.cs" />
<Compile Include="Configuration\CinemaModeConfiguration.cs" />
<Compile Include="Configuration\MetadataConfiguration.cs" />
<Compile Include="Configuration\PeopleMetadataOptions.cs" />
<Compile Include="Configuration\XbmcMetadataOptions.cs" />
<Compile Include="Configuration\SubtitlePlaybackMode.cs" />
Expand Down
4 changes: 4 additions & 0 deletions MediaBrowser.Providers/Manager/ProviderUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public static void MergeBaseItemData(BaseItem source, BaseItem target, List<Meta
if (replaceData || string.IsNullOrEmpty(target.HomePageUrl))
{
target.HomePageUrl = source.HomePageUrl;
if (!string.IsNullOrWhiteSpace(target.HomePageUrl) && target.HomePageUrl.IndexOf("http", StringComparison.OrdinalIgnoreCase) != 0)
{
target.HomePageUrl = "http://" + target.HomePageUrl;
}
}

if (replaceData || !target.IndexNumber.HasValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public string WanApiAddress
ip = "http://" + ip;
}

return ip + ":" + _config.Configuration.HttpServerPortNumber.ToString(CultureInfo.InvariantCulture);
return ip + ":" + _config.Configuration.PublicPort.ToString(CultureInfo.InvariantCulture);
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ private void CreateRules(INatDevice device)

var info = _appHost.GetSystemInfo();

CreatePortMap(device, info.HttpServerPortNumber);
CreatePortMap(device, info.HttpServerPortNumber, _config.Configuration.PublicPort);
}
}

private void CreatePortMap(INatDevice device, int port)
private void CreatePortMap(INatDevice device, int privatePort, int publicPort)
{
_logger.Debug("Creating port map on port {0}", port);
_logger.Debug("Creating port map on port {0}", privatePort);

device.CreatePortMap(new Mapping(Protocol.Tcp, port, port)
device.CreatePortMap(new Mapping(Protocol.Tcp, privatePort, publicPort)
{
Description = "Media Browser Server"
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public async Task<IEnumerable<IntroInfo>> GetIntros(BaseItem item, User user)
GetCustomIntros(item) :
new List<IntroInfo>();

var trailerLimit = 2;
var trailerLimit = config.TrailerLimit;
if (customIntros.Count > 0)
{
trailerLimit--;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@
"HeaderRuntime": "\u04b0\u0437\u0430\u049b\u0442\u044b\u0493\u044b",
"HeaderCommunityRating": "\u049a\u0430\u0443\u044b\u043c\u0434\u0430\u0441\u0442\u044b\u049b \u0431\u0430\u0493\u0430\u043b\u0430\u0443\u044b",
"HeaderParentalRating": "\u0416\u0430\u0441\u0442\u0430\u0441 \u0441\u0430\u043d\u0430\u0442\u044b",
"HeaderReleaseDate": "\u0428\u044b\u0493\u0430\u0440\u0443 \u043a\u04af\u043d-\u0430\u0439\u044b",
"HeaderDateAdded": "\u04ae\u0441\u0442\u0435\u0443 \u043a\u04af\u043d-\u0430\u0439\u044b",
"HeaderReleaseDate": "\u0428\u044b\u0493\u0430\u0440\u0443 \u043a\u04af\u043d\u0456",
"HeaderDateAdded": "\u04ae\u0441\u0442\u0435\u0443 \u043a\u04af\u043d\u0456",
"HeaderSeries": "\u0421\u0435\u0440\u0438\u0430\u043b",
"HeaderSeason": "\u041c\u0430\u0443\u0441\u044b\u043c",
"HeaderSeasonNumber": "\u041c\u0430\u0443\u0441\u044b\u043c \u043d\u04e9\u043c\u0456\u0440\u0456",
Expand Down Expand Up @@ -383,19 +383,19 @@
"PersonTypePerson": "\u0422\u04b1\u043b\u0493\u0430",
"LabelTitleDisplayOrder": "\u0422\u0443\u044b\u043d\u0434\u044b \u0431\u0435\u0439\u043d\u0435\u043b\u0435\u0443 \u0440\u0435\u0442\u0456:",
"OptionSortName": "\u0421\u04b1\u0440\u044b\u043f\u0442\u0430\u043b\u0430\u0442\u044b\u043d \u0430\u0442\u044b",
"OptionReleaseDate": "\u0428\u044b\u0493\u0430\u0440\u0443 \u043a\u04af\u043d-\u0430\u0439\u044b",
"OptionReleaseDate": "\u0428\u044b\u0493\u0430\u0440\u0443 \u043a\u04af\u043d\u0456",
"LabelSeasonNumber": "\u041c\u0430\u0443\u0441\u044b\u043c \u043d\u04e9\u043c\u0456\u0440\u0456:",
"LabelDiscNumber": "\u0414\u0438\u0441\u043a\u0456 \u043d\u04e9\u043c\u0456\u0440\u0456",
"LabelParentNumber": "\u0422\u0435\u043a\u0442\u0456\u043a \u043d\u04e9\u043c\u0456\u0440:",
"LabelEpisodeNumber": "\u042d\u043f\u0438\u0437\u043e\u0434 \u043d\u04e9\u043c\u0456\u0440\u0456:",
"LabelTrackNumber": "\u0416\u043e\u043b\u0448\u044b\u049b \u043d\u04e9\u043c\u0456\u0440\u0456:",
"LabelNumber": "\u041d\u04e9\u043c\u0456\u0440\u0456:",
"LabelReleaseDate": "\u0428\u044b\u0493\u0430\u0440\u0443 \u043a\u04af\u043d-\u0430\u0439\u044b:",
"LabelEndDate": "\u0410\u044f\u049b\u0442\u0430\u043b\u0443 \u043a\u04af\u043d-\u0430\u0439\u044b:",
"LabelReleaseDate": "\u0428\u044b\u0493\u0430\u0440\u0443 \u043a\u04af\u043d\u0456:",
"LabelEndDate": "\u0410\u044f\u049b\u0442\u0430\u043b\u0443 \u043a\u04af\u043d\u0456:",
"LabelYear": "\u0416\u044b\u043b\u044b:",
"LabelDateOfBirth": "\u0422\u0443\u0493\u0430\u043d \u043a\u04af\u043d-\u0430\u0439\u044b:",
"LabelDateOfBirth": "\u0422\u0443\u0493\u0430\u043d \u043a\u04af\u043d\u0456:",
"LabelBirthYear": "\u0422\u0443\u0493\u0430\u043d \u0436\u044b\u043b\u044b:",
"LabelDeathDate": "\u04e8\u043b\u0433\u0435\u043d \u043a\u04af\u043d-\u0430\u0439\u044b:",
"LabelDeathDate": "\u04e8\u043b\u0433\u0435\u043d \u043a\u04af\u043d\u0456:",
"HeaderRemoveMediaLocation": "\u0422\u0430\u0441\u0443\u0448\u044b\u0434\u0435\u0440\u0435\u043a\u0442\u0435\u0440 \u043e\u0440\u043d\u0430\u043b\u0430\u0441\u0443\u044b\u043d \u0430\u043b\u0430\u0441\u0442\u0430\u0443",
"MessageConfirmRemoveMediaLocation": "\u0428\u044b\u043d\u044b\u043c\u0435\u043d \u043e\u0441\u044b \u043e\u0440\u043d\u0430\u043b\u0430\u0441\u0443\u0434\u044b \u0430\u043b\u0430\u0441\u0442\u0430\u0443 \u049b\u0430\u0436\u0435\u0442 \u043f\u0435?",
"HeaderRenameMediaFolder": "\u0422\u0430\u0441\u0443\u0448\u044b \u049b\u0430\u043b\u0442\u0430\u0441\u044b\u043d \u049b\u0430\u0439\u0442\u0430 \u0430\u0442\u0430\u0443",
Expand Down Expand Up @@ -454,7 +454,7 @@
"TooltipLinkedToMediaBrowserConnect": "Media Browser Connect \u04af\u0448\u0456\u043d \u0431\u0430\u0439\u043b\u0430\u043d\u044b\u0441\u049b\u0430\u043d",
"HeaderUnrated": "\u0411\u0430\u0493\u0430\u043b\u0430\u043d\u0431\u0430\u0493\u0430\u043d",
"ValueDiscNumber": "{0}-\u0434\u0438\u0441\u043a\u0456",
"HeaderUnknownDate": "\u041a\u04af\u043d-\u0430\u0439\u044b \u0431\u0435\u043b\u0433\u0456\u0441\u0456\u0437",
"HeaderUnknownDate": "\u041a\u04af\u043d\u0456 \u0431\u0435\u043b\u0433\u0456\u0441\u0456\u0437",
"HeaderUnknownYear": "\u0416\u044b\u043b\u044b \u0431\u0435\u043b\u0433\u0456\u0441\u0456\u0437",
"ValueMinutes": "{0} \u043c\u0438\u043d",
"ButtonPlayExternalPlayer": "\u0421\u044b\u0440\u0442\u049b\u044b \u043e\u0439\u043d\u0430\u0442\u049b\u044b\u0448\u043f\u0435\u043d \u043e\u0439\u043d\u0430\u0442\u0443",
Expand Down
Loading

0 comments on commit 8020036

Please sign in to comment.