Some minor code cleanups

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti
2012-09-11 14:20:12 -04:00
parent 016590529f
commit 670a53258e
80 changed files with 318 additions and 1120 deletions

View File

@@ -46,7 +46,7 @@ namespace MediaBrowser.Controller.Resolvers.Movies
private void SetProviderIdFromPath(Movie item)
{
string srch = "[tmdbid=";
const string srch = "[tmdbid=";
int index = item.Path.IndexOf(srch, System.StringComparison.OrdinalIgnoreCase);
if (index != -1)

View File

@@ -48,8 +48,8 @@ namespace MediaBrowser.Controller.Resolvers.TV
private void SetProviderIdFromPath(Series item)
{
string srch = "[tvdbid=";
int index = item.Path.IndexOf(srch, System.StringComparison.OrdinalIgnoreCase);
const string srch = "[tvdbid=";
int index = item.Path.IndexOf(srch, StringComparison.OrdinalIgnoreCase);
if (index != -1)
{

View File

@@ -9,7 +9,7 @@ namespace MediaBrowser.Controller.Resolvers.TV
/// <summary>
/// A season folder must contain one of these somewhere in the name
/// </summary>
private static string[] SeasonFolderNames = new string[] {
private static readonly string[] SeasonFolderNames = new string[] {
"season",
"sæson",
"temporada",
@@ -118,14 +118,12 @@ namespace MediaBrowser.Controller.Resolvers.TV
{
return true;
}
else
{
nonSeriesFolders++;
if (nonSeriesFolders >= 3)
{
return false;
}
nonSeriesFolders++;
if (nonSeriesFolders >= 3)
{
return false;
}
}
else

View File

@@ -33,7 +33,7 @@ namespace MediaBrowser.Controller.Resolvers
{
VideoType type = Path.GetExtension(args.Path).EndsWith("iso", System.StringComparison.OrdinalIgnoreCase) ? VideoType.Iso : VideoType.VideoFile;
return new T()
return new T
{
VideoType = type,
Path = args.Path
@@ -77,15 +77,15 @@ namespace MediaBrowser.Controller.Resolvers
{
if (folder.IndexOf("video_ts", System.StringComparison.OrdinalIgnoreCase) != -1)
{
return new T()
return new T
{
VideoType = VideoType.DVD,
VideoType = VideoType.Dvd,
Path = Path.GetDirectoryName(folder)
};
}
if (folder.IndexOf("bdmv", System.StringComparison.OrdinalIgnoreCase) != -1)
{
return new T()
return new T
{
VideoType = VideoType.BluRay,
Path = Path.GetDirectoryName(folder)