From fd48879513b7699c12f0bcfdb4e7e7b6b0921f2f Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Wed, 3 Dec 2014 22:31:23 +0000 Subject: [PATCH] The fix for loading songs with linked audio. Fixes bug 1398403 Fixes: https://launchpad.net/bugs/1398403 --- openlp/core/lib/serviceitem.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 4e7ff032a..a7051b9d9 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -36,6 +36,7 @@ import html import logging import os import uuid +import ntpath from PyQt4 import QtGui @@ -423,8 +424,12 @@ class ServiceItem(RegistryProperties): if 'background_audio' in header: self.background_audio = [] for filename in header['background_audio']: - # Give them real file paths - self.background_audio.append(os.path.join(path, filename)) + # Give them real file paths. + 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) if self.service_item_type == ServiceItemType.Text: for slide in service_item['serviceitem']['data']: