make lazy loaded paths more nimble

This commit is contained in:
Luke Pulverenti 2013-12-29 09:12:29 -05:00
parent e19766b1b7
commit 3488cfecbd
13 changed files with 536 additions and 539 deletions

View File

@ -721,6 +721,7 @@ namespace MediaBrowser.Api.Playback
Logger.Info(process.StartInfo.FileName + " " + process.StartInfo.Arguments); Logger.Info(process.StartInfo.FileName + " " + process.StartInfo.Arguments);
var logFilePath = Path.Combine(ServerConfigurationManager.ApplicationPaths.LogDirectoryPath, "ffmpeg-" + Guid.NewGuid() + ".txt"); 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. // 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); state.LogFileStream = FileSystem.GetFileStream(logFilePath, FileMode.Create, FileAccess.Write, FileShare.Read, true);

View File

@ -92,10 +92,6 @@ namespace MediaBrowser.Common.Implementations
} }
} }
/// <summary>
/// The _plugins path
/// </summary>
private string _pluginsPath;
/// <summary> /// <summary>
/// Gets the path to the plugin directory /// Gets the path to the plugin directory
/// </summary> /// </summary>
@ -104,20 +100,10 @@ namespace MediaBrowser.Common.Implementations
{ {
get get
{ {
if (_pluginsPath == null) return Path.Combine(ProgramDataPath, "plugins");
{
_pluginsPath = Path.Combine(ProgramDataPath, "plugins");
Directory.CreateDirectory(_pluginsPath);
}
return _pluginsPath;
} }
} }
/// <summary>
/// The _plugin configurations path
/// </summary>
private string _pluginConfigurationsPath;
/// <summary> /// <summary>
/// Gets the path to the plugin configurations directory /// Gets the path to the plugin configurations directory
/// </summary> /// </summary>
@ -126,17 +112,10 @@ namespace MediaBrowser.Common.Implementations
{ {
get get
{ {
if (_pluginConfigurationsPath == null) return Path.Combine(PluginsPath, "configurations");
{
_pluginConfigurationsPath = Path.Combine(PluginsPath, "configurations");
Directory.CreateDirectory(_pluginConfigurationsPath);
}
return _pluginConfigurationsPath;
} }
} }
private string _tempUpdatePath;
/// <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>
@ -145,20 +124,10 @@ namespace MediaBrowser.Common.Implementations
{ {
get get
{ {
if (_tempUpdatePath == null) return Path.Combine(ProgramDataPath, "updates");
{
_tempUpdatePath = Path.Combine(ProgramDataPath, "updates");
Directory.CreateDirectory(_tempUpdatePath);
}
return _tempUpdatePath;
} }
} }
/// <summary>
/// The _log directory path
/// </summary>
private string _logDirectoryPath;
/// <summary> /// <summary>
/// Gets the path to the log directory /// Gets the path to the log directory
/// </summary> /// </summary>
@ -167,12 +136,7 @@ namespace MediaBrowser.Common.Implementations
{ {
get get
{ {
if (_logDirectoryPath == null) return Path.Combine(ProgramDataPath, "logs");
{
_logDirectoryPath = Path.Combine(ProgramDataPath, "logs");
Directory.CreateDirectory(_logDirectoryPath);
}
return _logDirectoryPath;
} }
} }

View File

@ -186,6 +186,8 @@ namespace MediaBrowser.Common.Implementations.Logging
{ {
LogFilePath = Path.Combine(LogDirectory, LogFilePrefix + "-" + decimal.Round(DateTime.Now.Ticks / 10000000) + ".log"); LogFilePath = Path.Combine(LogDirectory, LogFilePrefix + "-" + decimal.Round(DateTime.Now.Ticks / 10000000) + ".log");
Directory.CreateDirectory(Path.GetDirectoryName(LogFilePath));
AddFileTarget(LogFilePath, level); AddFileTarget(LogFilePath, level);
LogSeverity = level; LogSeverity = level;

View File

@ -528,6 +528,7 @@ namespace MediaBrowser.Common.Implementations.Updates
// Success - move it to the real target // Success - move it to the real target
try try
{ {
Directory.CreateDirectory(Path.GetDirectoryName(target));
File.Copy(tempFile, target, true); File.Copy(tempFile, target, true);
//If it is an archive - write out a version file so we know what it is //If it is an archive - write out a version file so we know what it is
if (isArchive) if (isArchive)

View File

@ -42,6 +42,8 @@ namespace MediaBrowser.Common.Configuration
// If the file didn't exist before, or if something has changed, re-save // If the file didn't exist before, or if something has changed, re-save
if (buffer == null || !buffer.SequenceEqual(newBytes)) if (buffer == null || !buffer.SequenceEqual(newBytes))
{ {
Directory.CreateDirectory(Path.GetDirectoryName(path));
// Save it after load in case we got new items // Save it after load in case we got new items
File.WriteAllBytes(path, newBytes); File.WriteAllBytes(path, newBytes);
} }

View File

@ -267,6 +267,8 @@ namespace MediaBrowser.Common.Plugins
{ {
lock (_configurationSaveLock) lock (_configurationSaveLock)
{ {
Directory.CreateDirectory(Path.GetDirectoryName(ConfigurationFilePath));
XmlSerializer.SerializeToFile(Configuration, ConfigurationFilePath); XmlSerializer.SerializeToFile(Configuration, ConfigurationFilePath);
} }
} }

View File

@ -58,6 +58,7 @@ namespace MediaBrowser.Controller.Entities
/// Gets or sets the path. /// Gets or sets the path.
/// </summary> /// </summary>
/// <value>The path.</value> /// <value>The path.</value>
[IgnoreDataMember]
public override string Path public override string Path
{ {
get get
@ -267,6 +268,11 @@ namespace MediaBrowser.Controller.Entities
/// <returns>System.String.</returns> /// <returns>System.String.</returns>
private string GetConfigurationDirectoryPath(string username) private string GetConfigurationDirectoryPath(string username)
{ {
if (string.IsNullOrEmpty(username))
{
throw new ArgumentNullException("username");
}
var safeFolderName = FileSystem.GetValidFilename(username); var safeFolderName = FileSystem.GetValidFilename(username);
return System.IO.Path.Combine(ConfigurationManager.ApplicationPaths.UserConfigurationDirectoryPath, safeFolderName); return System.IO.Path.Combine(ConfigurationManager.ApplicationPaths.UserConfigurationDirectoryPath, safeFolderName);

View File

@ -51,7 +51,7 @@ namespace MediaBrowser.Providers.Studios
if (backdrops) 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)); return Task.FromResult(list.Where(i => i != null));

View File

@ -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

View File

@ -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

View File

@ -454,6 +454,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder
_logger.Debug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments); _logger.Debug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
var logFilePath = Path.Combine(_appPaths.LogDirectoryPath, "ffmpeg-sub-convert-" + Guid.NewGuid() + ".txt"); 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); 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); _logger.Debug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
var logFilePath = Path.Combine(_appPaths.LogDirectoryPath, "ffmpeg-sub-extract-" + Guid.NewGuid() + ".txt"); 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); var logFileStream = _fileSystem.GetFileStream(logFilePath, FileMode.Create, FileAccess.Write, FileShare.Read, true);

View File

@ -542,9 +542,7 @@ namespace MediaBrowser.ServerApplication
/// <returns>IEnumerable{Assembly}.</returns> /// <returns>IEnumerable{Assembly}.</returns>
protected override IEnumerable<Assembly> GetComposablePartAssemblies() protected override IEnumerable<Assembly> GetComposablePartAssemblies()
{ {
var list = Directory.EnumerateFiles(ApplicationPaths.PluginsPath, "*.dll", SearchOption.TopDirectoryOnly) var list = GetPluginAssemblies()
.Select(LoadAssembly)
.Where(a => a != null)
.ToList(); .ToList();
// Gets all plugin assemblies by first reading all bytes of the .dll and calling Assembly.Load against that // 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; return list;
} }
/// <summary>
/// Gets the plugin assemblies.
/// </summary>
/// <returns>IEnumerable{Assembly}.</returns>
private IEnumerable<Assembly> GetPluginAssemblies()
{
try
{
return Directory.EnumerateFiles(ApplicationPaths.PluginsPath, "*.dll", SearchOption.TopDirectoryOnly)
.Select(LoadAssembly)
.Where(a => a != null);
}
catch (DirectoryNotFoundException)
{
return new List<Assembly>();
}
}
private readonly string _systemId = Environment.MachineName.GetMD5().ToString(); private readonly string _systemId = Environment.MachineName.GetMD5().ToString();
/// <summary> /// <summary>

View File

@ -405,6 +405,7 @@ namespace MediaBrowser.ServerApplication
_logger.ErrorException("UnhandledException", ex); _logger.ErrorException("UnhandledException", ex);
var path = Path.Combine(_appHost.ServerConfigurationManager.ApplicationPaths.LogDirectoryPath, "unhandled_" + Guid.NewGuid() + ".txt"); var path = Path.Combine(_appHost.ServerConfigurationManager.ApplicationPaths.LogDirectoryPath, "unhandled_" + Guid.NewGuid() + ".txt");
Directory.CreateDirectory(Path.GetDirectoryName(path));
var builder = LogHelper.GetLogMessage(ex); var builder = LogHelper.GetLogMessage(ex);