From 3488cfecbd54eaaf917d853664f68cac84d472e9 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 29 Dec 2013 09:12:29 -0500 Subject: [PATCH] make lazy loaded paths more nimble --- .../Playback/BaseStreamingService.cs | 1 + .../BaseApplicationPaths.cs | 44 +- .../Logging/NlogManager.cs | 2 + .../Updates/InstallationManager.cs | 1 + .../Configuration/ConfigurationHelper.cs | 2 + MediaBrowser.Common/Plugins/BasePlugin.cs | 2 + MediaBrowser.Controller/Entities/User.cs | 6 + .../Studios/StudiosManualImageProvider.cs | 2 +- MediaBrowser.Providers/Studios/backdrops.txt | 495 ++++++++++++++++++ MediaBrowser.Providers/Studios/posters.txt | 495 ------------------ .../MediaEncoder/MediaEncoder.cs | 2 + .../ApplicationHost.cs | 22 +- MediaBrowser.ServerApplication/MainStartup.cs | 1 + 13 files changed, 536 insertions(+), 539 deletions(-) diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index c04648c373..34ec15a709 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -721,6 +721,7 @@ namespace MediaBrowser.Api.Playback Logger.Info(process.StartInfo.FileName + " " + process.StartInfo.Arguments); var logFilePath = Path.Combine(ServerConfigurationManager.ApplicationPaths.LogDirectoryPath, "ffmpeg-" + Guid.NewGuid() + ".txt"); + Directory.CreateDirectory(Path.GetDirectoryName(logFilePath)); // FFMpeg writes debug/error info to stderr. This is useful when debugging so let's put it in the log directory. state.LogFileStream = FileSystem.GetFileStream(logFilePath, FileMode.Create, FileAccess.Write, FileShare.Read, true); diff --git a/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs b/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs index eba8f56988..213942c9dc 100644 --- a/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs +++ b/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs @@ -92,10 +92,6 @@ namespace MediaBrowser.Common.Implementations } } - /// - /// The _plugins path - /// - private string _pluginsPath; /// /// Gets the path to the plugin directory /// @@ -104,20 +100,10 @@ namespace MediaBrowser.Common.Implementations { get { - if (_pluginsPath == null) - { - _pluginsPath = Path.Combine(ProgramDataPath, "plugins"); - Directory.CreateDirectory(_pluginsPath); - } - - return _pluginsPath; + return Path.Combine(ProgramDataPath, "plugins"); } } - /// - /// The _plugin configurations path - /// - private string _pluginConfigurationsPath; /// /// Gets the path to the plugin configurations directory /// @@ -126,17 +112,10 @@ namespace MediaBrowser.Common.Implementations { get { - if (_pluginConfigurationsPath == null) - { - _pluginConfigurationsPath = Path.Combine(PluginsPath, "configurations"); - Directory.CreateDirectory(_pluginConfigurationsPath); - } - - return _pluginConfigurationsPath; + return Path.Combine(PluginsPath, "configurations"); } } - private string _tempUpdatePath; /// /// Gets the path to where temporary update files will be stored /// @@ -145,20 +124,10 @@ namespace MediaBrowser.Common.Implementations { get { - if (_tempUpdatePath == null) - { - _tempUpdatePath = Path.Combine(ProgramDataPath, "updates"); - Directory.CreateDirectory(_tempUpdatePath); - } - - return _tempUpdatePath; + return Path.Combine(ProgramDataPath, "updates"); } } - /// - /// The _log directory path - /// - private string _logDirectoryPath; /// /// Gets the path to the log directory /// @@ -167,12 +136,7 @@ namespace MediaBrowser.Common.Implementations { get { - if (_logDirectoryPath == null) - { - _logDirectoryPath = Path.Combine(ProgramDataPath, "logs"); - Directory.CreateDirectory(_logDirectoryPath); - } - return _logDirectoryPath; + return Path.Combine(ProgramDataPath, "logs"); } } diff --git a/MediaBrowser.Common.Implementations/Logging/NlogManager.cs b/MediaBrowser.Common.Implementations/Logging/NlogManager.cs index 56f2b5e291..fb7fd1698e 100644 --- a/MediaBrowser.Common.Implementations/Logging/NlogManager.cs +++ b/MediaBrowser.Common.Implementations/Logging/NlogManager.cs @@ -186,6 +186,8 @@ namespace MediaBrowser.Common.Implementations.Logging { LogFilePath = Path.Combine(LogDirectory, LogFilePrefix + "-" + decimal.Round(DateTime.Now.Ticks / 10000000) + ".log"); + Directory.CreateDirectory(Path.GetDirectoryName(LogFilePath)); + AddFileTarget(LogFilePath, level); LogSeverity = level; diff --git a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs index 0581343d39..18462ba9ba 100644 --- a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs +++ b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs @@ -528,6 +528,7 @@ namespace MediaBrowser.Common.Implementations.Updates // Success - move it to the real target try { + Directory.CreateDirectory(Path.GetDirectoryName(target)); File.Copy(tempFile, target, true); //If it is an archive - write out a version file so we know what it is if (isArchive) diff --git a/MediaBrowser.Common/Configuration/ConfigurationHelper.cs b/MediaBrowser.Common/Configuration/ConfigurationHelper.cs index 1f86c5c029..64c2e87de1 100644 --- a/MediaBrowser.Common/Configuration/ConfigurationHelper.cs +++ b/MediaBrowser.Common/Configuration/ConfigurationHelper.cs @@ -42,6 +42,8 @@ namespace MediaBrowser.Common.Configuration // If the file didn't exist before, or if something has changed, re-save if (buffer == null || !buffer.SequenceEqual(newBytes)) { + Directory.CreateDirectory(Path.GetDirectoryName(path)); + // Save it after load in case we got new items File.WriteAllBytes(path, newBytes); } diff --git a/MediaBrowser.Common/Plugins/BasePlugin.cs b/MediaBrowser.Common/Plugins/BasePlugin.cs index 795d22100a..aa1369c4e2 100644 --- a/MediaBrowser.Common/Plugins/BasePlugin.cs +++ b/MediaBrowser.Common/Plugins/BasePlugin.cs @@ -267,6 +267,8 @@ namespace MediaBrowser.Common.Plugins { lock (_configurationSaveLock) { + Directory.CreateDirectory(Path.GetDirectoryName(ConfigurationFilePath)); + XmlSerializer.SerializeToFile(Configuration, ConfigurationFilePath); } } diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.cs index 06f50e552b..a2c7bcb576 100644 --- a/MediaBrowser.Controller/Entities/User.cs +++ b/MediaBrowser.Controller/Entities/User.cs @@ -58,6 +58,7 @@ namespace MediaBrowser.Controller.Entities /// Gets or sets the path. /// /// The path. + [IgnoreDataMember] public override string Path { get @@ -267,6 +268,11 @@ namespace MediaBrowser.Controller.Entities /// System.String. private string GetConfigurationDirectoryPath(string username) { + if (string.IsNullOrEmpty(username)) + { + throw new ArgumentNullException("username"); + } + var safeFolderName = FileSystem.GetValidFilename(username); return System.IO.Path.Combine(ConfigurationManager.ApplicationPaths.UserConfigurationDirectoryPath, safeFolderName); diff --git a/MediaBrowser.Providers/Studios/StudiosManualImageProvider.cs b/MediaBrowser.Providers/Studios/StudiosManualImageProvider.cs index 80ccbd6cb6..8255c6d560 100644 --- a/MediaBrowser.Providers/Studios/StudiosManualImageProvider.cs +++ b/MediaBrowser.Providers/Studios/StudiosManualImageProvider.cs @@ -51,7 +51,7 @@ namespace MediaBrowser.Providers.Studios if (backdrops) { - list.Add(GetImage(item, "backdrops.txt", ImageType.Backdrop, "backdrop")); + //list.Add(GetImage(item, "backdrops.txt", ImageType.Backdrop, "backdrop")); } return Task.FromResult(list.Where(i => i != null)); diff --git a/MediaBrowser.Providers/Studios/backdrops.txt b/MediaBrowser.Providers/Studios/backdrops.txt index e69de29bb2..0d3ad46119 100644 --- a/MediaBrowser.Providers/Studios/backdrops.txt +++ b/MediaBrowser.Providers/Studios/backdrops.txt @@ -0,0 +1,495 @@ +15 Gigs +19 Entertainment +20th Television +321 Productions +4K Media +4Kids Entertainment +A La Carte Communications +A&E +Aardman +ABC +ABC Family +ABC News +ABC Studios +Above Average +Acacia Fitness +Action Television +Advertising Age +All Channel Films +All3Media +Alli +Alliance Entertainment +Alloy +AllWarriorNetwork +American Pop Classics +Ananey +Anchor Bay Entertainment +Anderson Digital +Animal Planet +Animation Domination High-Def +Anime Network +Aniplex +Anyone But Me, LLC +Artists Den Entertainment +Asian Crush +Atlantic Records +Attention Span +Austin City Limits Music Festival +Australian Broadcasting Corporation +Australian Food TV +Avalon UK +Azteca America +Bandai +Base 79 +BBC Worldwide +Beliefnet +Believe +BET +Beta Film +Big Air Studios +BIGFlix +bio +Blame Society +Blastro Networks +Bloody Disgusting Selects +Bloomberg +Bonnier TV Group +Border Entertainment +Brain Farm +Brainstorm Media +Brave New Films +Bravo +Broadway Video +Brushfire Records +Butaca +BVTV +C3 Entertainment +Canal 13 de Chile +Candlelight Media +Candor TV +Caracol Television +Carsey Werner +CBS +CelebTV +Charlie Rose +Cheflive +CHIC.TV +Chiller +China Lion +Cine Real +Cinedigm +CINELAN +Cinema Guild +Cinema Libre Studio +Cinema Purgatorio +CineSport +Cirque du Soleil +Citizens United Productions No. 3 +CJ Entertainment +Classic Media +Clinton Global Initiative +Cloo +ClubWPT +CNBC +CODA BOOKS +CollegeHumor +Comedy Central +Comedy Time +Conde Nast Digital +Constantin Film +Content and Co +Content Family +Content Media Corporation +Contentino +Cooking Channel +Crackle +Crime & Investigation Network +Criterion Collection +CRM +Cuppa Coffee +Dark Sky Films +Dave Matthews Band +Davis Panzer +Debutante Inc +Digital Artists +Digital Rights Group +Digital Studios +Discovery Channel +Discovery +Distribber +Diva +DIY Network +DocComTV +DramaFever +Duopoly +E! Entertainment +EA Sports +Eagle Media +Eagle Rock +Echo Bridge Entertainment +Echo Pictures +EchoBoom Sports +Edmunds +ElecPlay +Electric Entertainment +Electric Sky +ELLE +EMI +Enchanted Tales +Endemol +Entertainment Rights +eOne Entertainment Distribution +Epicurious.com +Eqal +Esquire Network +Estrella TV +Everyday Edisons +Evil Global +Exclusive Media +ExerciseTV +Fanclub +Fangoria +FEARnet +Fever Dreams +Fight TV +Film Ideas on Demand +Film Movement +Film Sales Company +FilmBuff +Finley-Holiday Films +First Look Studios +First Run Features +Focus Features +Food Network +FORA.tv +Ford +FOX +Fox Business +Fox College Sports +Fox Movie Channel +Fox News +Fox Reality +Fox Sports +Fox Sports Net +Fox Television Classics +Frantic Films +FremantleMedia +FUEL TV +FUNimation +FX +FXM +FXX +G4 +Gaiam +Galavision +GameTrailers +Generate +George Dickel +Giant Ape Media +Glamour Films +GoDigital +Golf TV +Gong +Gorilla Pictures +Gravitas +Gravitas Horror +GreenLight Media +GT Media +H2 +Handmade TV +Hat Trick +HD Films, Inc +Health Science Channel +HealthiNation +HereTV +HGTV +Historic Films +History +History en Español +HitFix +Hollywood Pictures +How it Works +Howcast +Howdini +Hudsun Media +Hulu Original Series +Hype +Iconix +iCue.com +IFC +IFC Films +IGN +Image Entertainment +Imagina US +Independent Comedy Network +Independent International Pictures Corp +Indie Crush +IndieFlix +itsallinyourhands.tv +ITV +ITV1 +Janson Media +Jim Henson Family TV +K2 +KCET +Kidz Bop +Kino Lorber +KinoNation +Klown +Koan +L Studio +Lagardere +Laguna Productions +Latin Crush +Legend Fighting Championship +Legend Films +Lifetime +Link TV +Lionsgate +Liquid Comics +Litton Entertainment +LMN +Local Food Sustainable Network +Logo +lolflix +Long Way Round +Look +Lou Reda Productions +Lucha Libre USA +LXTV +MAN +Manga Entertainment +Manolin Studios +Mar Vista +Martha Stewart Living +Marvel +Maverick Entertainment +Maya +MBC America +Media Blasters +Mentorn +MGM +MHz Networks +Midnight Pulp +Military History +Millennium Media Services +Modelinia +Mojo +MoMedia +Monterey Media +Moonscoop +Moshcam +Movieola +Movies by OHM +Moving Art +MPI +MSNBC +MTV +MulticomTV +MVD Entertainment Group +My Vortexx +My Yoga +MyNetworkTV +NASA +Nat Geo Wild +National Geographic Channel +NBC +NBC News +NBC Sports +NBC Universal +NBCU TV +NCircle +Netflix +New Renaissance +NHL +Nickelodeon +NickMom +Nikki Sixx +Nirvana Films +NIS America +Novel Ruby Productions +NowThisNews +nuvoTV +O2 Media +OhmTV +Oops Doughnuts +Ora TV +Orange Lounge +ORF Universum +Oscilloscope Laboratories +Oxygen +Paley Media +Panna +Paranormal TV +Passion River +PBS Kids +Phase 4 Films +Players Network +Plum TV +PopSugar TV +Power Rangers +PPI Releasing +PRO +Pure Adrenaline +Pure History +Pure Nature +Pure Science +Questar +Quintus Media +Quiver +Rajshri Media +Raphael Saadiq +Razor & Tie +RCTV +Real Magic TV +Red Bull +Red Hour Digital +ReelAfrican +ReelzChannel +Revolver +Rick Steves' Network +RiffTrax +Right Network +Riverhorse +Roadside Attractions +Ron Hazelton Productions +RooftopComedy +Rovio +RSA +RT +RTE +S and S Entertainment +Saavn +Sachs Judah +Salient Media +Satelight +Saturday Morning TV +SBS +SBS Australia +Scholastic +Science Channel +Scott Entertainment +Screen Media +Sesame Street +Shaftesbury +Shemaroo +Shochiku +Shout! Factory +Showtime +Shree International +Sky Studios +SnagFilms +SOFA +SOMA +Sonar Entertainment +Sony Pictures Television +SoPeachi +Source Interlink Media +SpaceRip +SPEED +Speed Racer Enterprises +Spike +Spike TV +Stand Up To Cancer +Starz +Strand Releasing +Strike.TV +Sundance Channel +SunWorld Pictures +Sweet Irony +Syfy +Syndicado +Synergetic +Talking Baseball with Ed Randall +Tantao Entertainment +TasteTV +Telepictures +TenduTV +The Cannell Studios +The CW +The Democratic National Convention +The Denis Leary Podcasts +The Global Film Initiative +The Jim Henson Company +The Kitchen Diva +The LXD +The Military Network +The Morning After +The National Film Board of Canada +The New York Times +The Onion +The OnLine Network +The Orchard +The Rebound +The Situation Workout +The Sundance Institute +The Three Stooges +The Weinstein Company +The White House +The Wine Library +The Zalman King Company +This Week In Studios +Thunderbird +Tiny Island Productions +TLA Releasing +TLC +TMS Entertainment +Toei Animation +Tokyopop +Total College Sports +Total Content Digital +Touchstone Pictures +Tr3s +Transworld +Travel Channel +Troma +TV Globo +TV Land +TVF International +TVG Interactive Horseracing +TVGN +Twentieth Century Fox +Uncork'd Entertainment +UniMas +Universal Pictures +Universal Sports +Universal Television +Univision +unwrapped.tv +USA +USA Network +uStudio +Vanguard Cinema +Venevision +Venus +VH1 +Vibrant Media +Videofashion +viewster +ViKi +Virgil Films +Vision Films +Vivendi Entertainment +VIZ Media +Vogue.TV +Wall Street Journal +Warner Bros. Records +WatchMojo.com +Water.org +WCG +WE tv +Web Therapy +Well Go +WEP +Westchester Films +Wolfe Video +WWE +Yan Can Cook +Young Hollywood +YourTango +ZDF Enterprises +ZED +Zeitgeist Films +Zodiak Kids +Zodiak Rights +ZoomTV \ No newline at end of file diff --git a/MediaBrowser.Providers/Studios/posters.txt b/MediaBrowser.Providers/Studios/posters.txt index 0d3ad46119..e69de29bb2 100644 --- a/MediaBrowser.Providers/Studios/posters.txt +++ b/MediaBrowser.Providers/Studios/posters.txt @@ -1,495 +0,0 @@ -15 Gigs -19 Entertainment -20th Television -321 Productions -4K Media -4Kids Entertainment -A La Carte Communications -A&E -Aardman -ABC -ABC Family -ABC News -ABC Studios -Above Average -Acacia Fitness -Action Television -Advertising Age -All Channel Films -All3Media -Alli -Alliance Entertainment -Alloy -AllWarriorNetwork -American Pop Classics -Ananey -Anchor Bay Entertainment -Anderson Digital -Animal Planet -Animation Domination High-Def -Anime Network -Aniplex -Anyone But Me, LLC -Artists Den Entertainment -Asian Crush -Atlantic Records -Attention Span -Austin City Limits Music Festival -Australian Broadcasting Corporation -Australian Food TV -Avalon UK -Azteca America -Bandai -Base 79 -BBC Worldwide -Beliefnet -Believe -BET -Beta Film -Big Air Studios -BIGFlix -bio -Blame Society -Blastro Networks -Bloody Disgusting Selects -Bloomberg -Bonnier TV Group -Border Entertainment -Brain Farm -Brainstorm Media -Brave New Films -Bravo -Broadway Video -Brushfire Records -Butaca -BVTV -C3 Entertainment -Canal 13 de Chile -Candlelight Media -Candor TV -Caracol Television -Carsey Werner -CBS -CelebTV -Charlie Rose -Cheflive -CHIC.TV -Chiller -China Lion -Cine Real -Cinedigm -CINELAN -Cinema Guild -Cinema Libre Studio -Cinema Purgatorio -CineSport -Cirque du Soleil -Citizens United Productions No. 3 -CJ Entertainment -Classic Media -Clinton Global Initiative -Cloo -ClubWPT -CNBC -CODA BOOKS -CollegeHumor -Comedy Central -Comedy Time -Conde Nast Digital -Constantin Film -Content and Co -Content Family -Content Media Corporation -Contentino -Cooking Channel -Crackle -Crime & Investigation Network -Criterion Collection -CRM -Cuppa Coffee -Dark Sky Films -Dave Matthews Band -Davis Panzer -Debutante Inc -Digital Artists -Digital Rights Group -Digital Studios -Discovery Channel -Discovery -Distribber -Diva -DIY Network -DocComTV -DramaFever -Duopoly -E! Entertainment -EA Sports -Eagle Media -Eagle Rock -Echo Bridge Entertainment -Echo Pictures -EchoBoom Sports -Edmunds -ElecPlay -Electric Entertainment -Electric Sky -ELLE -EMI -Enchanted Tales -Endemol -Entertainment Rights -eOne Entertainment Distribution -Epicurious.com -Eqal -Esquire Network -Estrella TV -Everyday Edisons -Evil Global -Exclusive Media -ExerciseTV -Fanclub -Fangoria -FEARnet -Fever Dreams -Fight TV -Film Ideas on Demand -Film Movement -Film Sales Company -FilmBuff -Finley-Holiday Films -First Look Studios -First Run Features -Focus Features -Food Network -FORA.tv -Ford -FOX -Fox Business -Fox College Sports -Fox Movie Channel -Fox News -Fox Reality -Fox Sports -Fox Sports Net -Fox Television Classics -Frantic Films -FremantleMedia -FUEL TV -FUNimation -FX -FXM -FXX -G4 -Gaiam -Galavision -GameTrailers -Generate -George Dickel -Giant Ape Media -Glamour Films -GoDigital -Golf TV -Gong -Gorilla Pictures -Gravitas -Gravitas Horror -GreenLight Media -GT Media -H2 -Handmade TV -Hat Trick -HD Films, Inc -Health Science Channel -HealthiNation -HereTV -HGTV -Historic Films -History -History en Español -HitFix -Hollywood Pictures -How it Works -Howcast -Howdini -Hudsun Media -Hulu Original Series -Hype -Iconix -iCue.com -IFC -IFC Films -IGN -Image Entertainment -Imagina US -Independent Comedy Network -Independent International Pictures Corp -Indie Crush -IndieFlix -itsallinyourhands.tv -ITV -ITV1 -Janson Media -Jim Henson Family TV -K2 -KCET -Kidz Bop -Kino Lorber -KinoNation -Klown -Koan -L Studio -Lagardere -Laguna Productions -Latin Crush -Legend Fighting Championship -Legend Films -Lifetime -Link TV -Lionsgate -Liquid Comics -Litton Entertainment -LMN -Local Food Sustainable Network -Logo -lolflix -Long Way Round -Look -Lou Reda Productions -Lucha Libre USA -LXTV -MAN -Manga Entertainment -Manolin Studios -Mar Vista -Martha Stewart Living -Marvel -Maverick Entertainment -Maya -MBC America -Media Blasters -Mentorn -MGM -MHz Networks -Midnight Pulp -Military History -Millennium Media Services -Modelinia -Mojo -MoMedia -Monterey Media -Moonscoop -Moshcam -Movieola -Movies by OHM -Moving Art -MPI -MSNBC -MTV -MulticomTV -MVD Entertainment Group -My Vortexx -My Yoga -MyNetworkTV -NASA -Nat Geo Wild -National Geographic Channel -NBC -NBC News -NBC Sports -NBC Universal -NBCU TV -NCircle -Netflix -New Renaissance -NHL -Nickelodeon -NickMom -Nikki Sixx -Nirvana Films -NIS America -Novel Ruby Productions -NowThisNews -nuvoTV -O2 Media -OhmTV -Oops Doughnuts -Ora TV -Orange Lounge -ORF Universum -Oscilloscope Laboratories -Oxygen -Paley Media -Panna -Paranormal TV -Passion River -PBS Kids -Phase 4 Films -Players Network -Plum TV -PopSugar TV -Power Rangers -PPI Releasing -PRO -Pure Adrenaline -Pure History -Pure Nature -Pure Science -Questar -Quintus Media -Quiver -Rajshri Media -Raphael Saadiq -Razor & Tie -RCTV -Real Magic TV -Red Bull -Red Hour Digital -ReelAfrican -ReelzChannel -Revolver -Rick Steves' Network -RiffTrax -Right Network -Riverhorse -Roadside Attractions -Ron Hazelton Productions -RooftopComedy -Rovio -RSA -RT -RTE -S and S Entertainment -Saavn -Sachs Judah -Salient Media -Satelight -Saturday Morning TV -SBS -SBS Australia -Scholastic -Science Channel -Scott Entertainment -Screen Media -Sesame Street -Shaftesbury -Shemaroo -Shochiku -Shout! Factory -Showtime -Shree International -Sky Studios -SnagFilms -SOFA -SOMA -Sonar Entertainment -Sony Pictures Television -SoPeachi -Source Interlink Media -SpaceRip -SPEED -Speed Racer Enterprises -Spike -Spike TV -Stand Up To Cancer -Starz -Strand Releasing -Strike.TV -Sundance Channel -SunWorld Pictures -Sweet Irony -Syfy -Syndicado -Synergetic -Talking Baseball with Ed Randall -Tantao Entertainment -TasteTV -Telepictures -TenduTV -The Cannell Studios -The CW -The Democratic National Convention -The Denis Leary Podcasts -The Global Film Initiative -The Jim Henson Company -The Kitchen Diva -The LXD -The Military Network -The Morning After -The National Film Board of Canada -The New York Times -The Onion -The OnLine Network -The Orchard -The Rebound -The Situation Workout -The Sundance Institute -The Three Stooges -The Weinstein Company -The White House -The Wine Library -The Zalman King Company -This Week In Studios -Thunderbird -Tiny Island Productions -TLA Releasing -TLC -TMS Entertainment -Toei Animation -Tokyopop -Total College Sports -Total Content Digital -Touchstone Pictures -Tr3s -Transworld -Travel Channel -Troma -TV Globo -TV Land -TVF International -TVG Interactive Horseracing -TVGN -Twentieth Century Fox -Uncork'd Entertainment -UniMas -Universal Pictures -Universal Sports -Universal Television -Univision -unwrapped.tv -USA -USA Network -uStudio -Vanguard Cinema -Venevision -Venus -VH1 -Vibrant Media -Videofashion -viewster -ViKi -Virgil Films -Vision Films -Vivendi Entertainment -VIZ Media -Vogue.TV -Wall Street Journal -Warner Bros. Records -WatchMojo.com -Water.org -WCG -WE tv -Web Therapy -Well Go -WEP -Westchester Films -Wolfe Video -WWE -Yan Can Cook -Young Hollywood -YourTango -ZDF Enterprises -ZED -Zeitgeist Films -Zodiak Kids -Zodiak Rights -ZoomTV \ No newline at end of file diff --git a/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs b/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs index 9df8334d5b..187dc19bf8 100644 --- a/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs +++ b/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs @@ -454,6 +454,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder _logger.Debug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments); var logFilePath = Path.Combine(_appPaths.LogDirectoryPath, "ffmpeg-sub-convert-" + Guid.NewGuid() + ".txt"); + Directory.CreateDirectory(Path.GetDirectoryName(logFilePath)); var logFileStream = _fileSystem.GetFileStream(logFilePath, FileMode.Create, FileAccess.Write, FileShare.Read, true); @@ -684,6 +685,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder _logger.Debug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments); var logFilePath = Path.Combine(_appPaths.LogDirectoryPath, "ffmpeg-sub-extract-" + Guid.NewGuid() + ".txt"); + Directory.CreateDirectory(Path.GetDirectoryName(logFilePath)); var logFileStream = _fileSystem.GetFileStream(logFilePath, FileMode.Create, FileAccess.Write, FileShare.Read, true); diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs index 00db91f41f..935067a336 100644 --- a/MediaBrowser.ServerApplication/ApplicationHost.cs +++ b/MediaBrowser.ServerApplication/ApplicationHost.cs @@ -542,9 +542,7 @@ namespace MediaBrowser.ServerApplication /// IEnumerable{Assembly}. protected override IEnumerable GetComposablePartAssemblies() { - var list = Directory.EnumerateFiles(ApplicationPaths.PluginsPath, "*.dll", SearchOption.TopDirectoryOnly) - .Select(LoadAssembly) - .Where(a => a != null) + var list = GetPluginAssemblies() .ToList(); // Gets all plugin assemblies by first reading all bytes of the .dll and calling Assembly.Load against that @@ -582,6 +580,24 @@ namespace MediaBrowser.ServerApplication return list; } + /// + /// Gets the plugin assemblies. + /// + /// IEnumerable{Assembly}. + private IEnumerable GetPluginAssemblies() + { + try + { + return Directory.EnumerateFiles(ApplicationPaths.PluginsPath, "*.dll", SearchOption.TopDirectoryOnly) + .Select(LoadAssembly) + .Where(a => a != null); + } + catch (DirectoryNotFoundException) + { + return new List(); + } + } + private readonly string _systemId = Environment.MachineName.GetMD5().ToString(); /// diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.cs index 6bf78c4e14..7da17bc225 100644 --- a/MediaBrowser.ServerApplication/MainStartup.cs +++ b/MediaBrowser.ServerApplication/MainStartup.cs @@ -405,6 +405,7 @@ namespace MediaBrowser.ServerApplication _logger.ErrorException("UnhandledException", ex); var path = Path.Combine(_appHost.ServerConfigurationManager.ApplicationPaths.LogDirectoryPath, "unhandled_" + Guid.NewGuid() + ".txt"); + Directory.CreateDirectory(Path.GetDirectoryName(path)); var builder = LogHelper.GetLogMessage(ex);