summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Utilities
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Utilities')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs29
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs1
2 files changed, 28 insertions, 2 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
index 4b50eef1a..b28de2264 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
@@ -19,6 +19,7 @@ namespace HandBrake.ApplicationServices.Utilities
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Model.Encoding;
+ using HandBrake.ApplicationServices.Services;
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.Interop.Model.Encoding;
using HandBrake.Interop.Model.Encoding.x264;
@@ -31,7 +32,7 @@ namespace HandBrake.ApplicationServices.Utilities
/// <summary>
/// Backing field for the user settings service.
/// </summary>
- private static readonly IUserSettingService UserSettingService = IoC.Get<IUserSettingService>();
+ private static IUserSettingService UserSettingService;
/// <summary>
/// Generate a CLI Query for an EncodeTask Model object
@@ -44,6 +45,19 @@ namespace HandBrake.ApplicationServices.Utilities
/// </returns>
public static string GenerateQuery(EncodeTask task)
{
+ // TODO Remove this quick hack
+ if (UserSettingService == null)
+ {
+ try
+ {
+ UserSettingService = IoC.Get<IUserSettingService>();
+ }
+ catch (Exception exc)
+ {
+ UserSettingService = new UserSettingService();
+ }
+ }
+
string query = string.Empty;
query += SourceQuery(task, null, null);
query += DestinationQuery(task);
@@ -69,6 +83,19 @@ namespace HandBrake.ApplicationServices.Utilities
/// </returns>
public static string GeneratePreviewQuery(EncodeTask task, int duration, string startAtPreview)
{
+ // TODO Remove this quick hack
+ if (UserSettingService == null)
+ {
+ try
+ {
+ UserSettingService = IoC.Get<IUserSettingService>();
+ }
+ catch (Exception exc)
+ {
+ UserSettingService = new UserSettingService();
+ }
+ }
+
string query = string.Empty;
query += SourceQuery(task, duration, startAtPreview);
query += DestinationQuery(task);
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
index e16274fe6..c13511580 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
@@ -10,7 +10,6 @@
namespace HandBrake.ApplicationServices.Utilities
{
using System;
- using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;