The fix for loading songs with linked audio. Fixes bug 1398403

Fixes: https://launchpad.net/bugs/1398403
This commit is contained in:
Tomas Groth 2014-12-03 22:31:23 +00:00
parent 0038ffcbe6
commit fd48879513

View File

@ -36,6 +36,7 @@ import html
import logging import logging
import os import os
import uuid import uuid
import ntpath
from PyQt4 import QtGui from PyQt4 import QtGui
@ -423,8 +424,12 @@ class ServiceItem(RegistryProperties):
if 'background_audio' in header: if 'background_audio' in header:
self.background_audio = [] self.background_audio = []
for filename in header['background_audio']: for filename in header['background_audio']:
# Give them real file paths # Give them real file paths.
self.background_audio.append(os.path.join(path, filename)) filepath = filename
if path:
# Windows can handle both forward and backward slashes, so we use ntpath to get the basename
filepath = os.path.join(path, ntpath.basename(filename))
self.background_audio.append(filepath)
self.theme_overwritten = header.get('theme_overwritten', False) self.theme_overwritten = header.get('theme_overwritten', False)
if self.service_item_type == ServiceItemType.Text: if self.service_item_type == ServiceItemType.Text:
for slide in service_item['serviceitem']['data']: for slide in service_item['serviceitem']['data']: