Converting things with same filename at the same time doesn't work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SoundConverter |
Fix Released
|
Critical
|
GautierPortet |
Bug Description
So, real world example first. I was trying to convert all the music of one artist at the same time. The problem arose when the first track on an EP was also the first track on an album. Because the two files were to be converted at the same time the name of the temporary file was the same for both. This made it give the following error:
GStreamer Error:
Could not open resource for writing.
<filename>
An easy fix would seem to me to attach a random string at the end of the temporary file. The following diff (against the 2.1.3 tree) fixed the problem for me.
@@ -21,6 +21,7 @@
import os
import sys
+from random import random
from urlparse import urlparse
from gettext import gettext as _
@@ -688,7 +689,7 @@ class ConverterQueue(
def add(self, sound_file):
# generate a temporary filename from source name and output suffix
- output_filename = self.window.
+ output_filename = self.window.
if vfs_exists(
# always overwrite temporary files
Changed in soundconverter: | |
assignee: | nobody → GautierPortet (kassoulet) |
milestone: | none → 3.0 |
milestone: | 3.0 → 2.1.4 |
importance: | Undecided → Critical |
status: | New → Confirmed |
Changed in soundconverter: | |
status: | Fix Committed → Fix Released |
Raises the question whether generate_ temp_filename( ) should return unique file names to begin with, instead of appending a random string anywhere the function is reused?