diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-04-05 00:13:41 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-04-05 00:13:41 -0400 |
| commit | 5ba769f3b41283efb8e7fb3a2407aafe0d6541d4 (patch) | |
| tree | f254e0cdfb02356132aab74232831b2c174341af /MediaBrowser.Controller/MediaInfo | |
| parent | 0bc542b19135dc29d23f89e4b067bc4fda81c3d2 (diff) | |
#79 - Music Image Extraction
Diffstat (limited to 'MediaBrowser.Controller/MediaInfo')
| -rw-r--r-- | MediaBrowser.Controller/MediaInfo/FFMpegManager.cs | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs b/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs index 3a4f3cae7e..f0a960ce1b 100644 --- a/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs +++ b/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs @@ -735,16 +735,16 @@ namespace MediaBrowser.Controller.MediaInfo /// <summary> /// Extracts an image from an Audio file and returns a Task whose result indicates whether it was successful or not /// </summary> - /// <param name="input">The input.</param> + /// <param name="inputPath">The input path.</param> /// <param name="outputPath">The output path.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task{System.Boolean}.</returns> /// <exception cref="System.ArgumentNullException">input</exception> - public async Task<bool> ExtractImage(Audio input, string outputPath, CancellationToken cancellationToken) + public async Task<bool> ExtractAudioImage(string inputPath, string outputPath, CancellationToken cancellationToken) { - if (input == null) + if (string.IsNullOrEmpty(inputPath)) { - throw new ArgumentNullException("input"); + throw new ArgumentNullException("inputPath"); } if (string.IsNullOrEmpty(outputPath)) @@ -759,7 +759,7 @@ namespace MediaBrowser.Controller.MediaInfo CreateNoWindow = true, UseShellExecute = false, FileName = FFMpegPath, - Arguments = string.Format("-i {0} -threads 0 -v quiet -f image2 \"{1}\"", GetInputArgument(input), outputPath), + Arguments = string.Format("-i {0} -threads 0 -v quiet -f image2 \"{1}\"", GetFileInputArgument(inputPath), outputPath), WindowStyle = ProcessWindowStyle.Hidden, ErrorDialog = false } @@ -780,7 +780,7 @@ namespace MediaBrowser.Controller.MediaInfo return true; } - _logger.Error("ffmpeg audio image extraction failed for {0}", input.Path); + _logger.Error("ffmpeg audio image extraction failed for {0}", inputPath); return false; } @@ -1040,6 +1040,16 @@ namespace MediaBrowser.Controller.MediaInfo } /// <summary> + /// Gets the file input argument. + /// </summary> + /// <param name="path">The path.</param> + /// <returns>System.String.</returns> + private string GetFileInputArgument(string path) + { + return string.Format("file:\"{0}\"", path); + } + + /// <summary> /// Gets the input argument. /// </summary> /// <param name="item">The item.</param> |
