[longomatch] Fix directory name for live automatic exports
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Fix directory name for live automatic exports
- Date: Thu, 29 Jan 2015 16:03:04 +0000 (UTC)
commit a135d0a0187a29c4958627953ac7b65efe8dc9b7
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Thu Jan 29 16:39:07 2015 +0100
Fix directory name for live automatic exports
LongoMatch.Core/Store/ProjectDescription.cs | 15 +++++++++++++++
LongoMatch.Services/Services/EventsManager.cs | 9 ++++++---
2 files changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/LongoMatch.Core/Store/ProjectDescription.cs b/LongoMatch.Core/Store/ProjectDescription.cs
index 5db5f07..db426aa 100644
--- a/LongoMatch.Core/Store/ProjectDescription.cs
+++ b/LongoMatch.Core/Store/ProjectDescription.cs
@@ -53,6 +53,21 @@ namespace LongoMatch.Core.Store
}
}
+ [JsonIgnore]
+ public String DateTitle {
+ get {
+ string ret = String.Format ("{0}-{1} {2}", LocalName, VisitorName,
+ MatchDate.ToShortDateString());
+ if (!String.IsNullOrEmpty (Season)) {
+ ret += " " + Season;
+ }
+ if (!String.IsNullOrEmpty (Competition)) {
+ ret += " " + Competition;
+ }
+ return ret;
+ }
+ }
+
/// <summary>
/// Media file asigned to this project
/// </summary>
diff --git a/LongoMatch.Services/Services/EventsManager.cs b/LongoMatch.Services/Services/EventsManager.cs
index 4dac415..a300fb8 100644
--- a/LongoMatch.Services/Services/EventsManager.cs
+++ b/LongoMatch.Services/Services/EventsManager.cs
@@ -215,7 +215,7 @@ namespace LongoMatch.Services
Playlist playlist;
EncodingSettings settings;
EditionJob job;
- string outputDir, outputFile;
+ string outputDir, outputProjectDir, outputFile;
if (Config.AutoRenderDir == null ||
!Directory.Exists (Config.AutoRenderDir)) {
@@ -224,12 +224,15 @@ namespace LongoMatch.Services
outputDir = Config.AutoRenderDir;
}
+ outputProjectDir = Path.Combine (outputDir,
+ Utils.SanitizePath (project.Description.DateTitle));
outputFile = String.Format ("{0}-{1}.mp4", play.EventType.Name, play.Name);
- outputFile = Path.Combine (outputDir, project.Description.Title, outputFile);
+ outputFile = Utils.SanitizePath (outputFile, ' ');
+ outputFile = Path.Combine (outputProjectDir, outputFile);
try {
PlaylistPlayElement element;
- Directory.CreateDirectory (Path.GetDirectoryName (outputFile));
+ Directory.CreateDirectory (outputProjectDir);
settings = EncodingSettings.DefaultRenderingSettings (outputFile);
playlist = new Playlist ();
element = new PlaylistPlayElement (play, project.Description.FileSet);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]