Store media_file with relative path
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenLP |
Fix Committed
|
Wishlist
|
Phill |
Bug Description
The path stored on table "media_files", in songs.sqlite is the full path. Is there a way to change this to save the relative path independent of OS (unix vs Windows), based on data path?
All my database is on Windows (with a lot of linked audios), I installed OpenLP in a linux machine and just copy & paste the songs and themes folders. But the linked audios don't play (because of the 'old' path). So, I had to update the instances of "media_files" with SQL commands, like these:
UPDATE media_files SET file_name = REPLACE(file_name, '\', '/');
UPDATE media_files SET file_name = REPLACE(file_name, 'C:/Users/
Old OpenLP machine: Windows 7
New OpenLP machine: Ubuntu 16.04
OpenLP version: 2.4.6 (both)
Related branches
- Tomas Groth: Approve
- Tim Bentley: Approve
-
Diff: 3277 lines (+662/-713)66 files modifiedopenlp/core/lib/serviceitem.py (+2/-2)
openlp/core/ui/maindisplay.py (+1/-1)
openlp/core/ui/servicemanager.py (+3/-1)
openlp/core/ui/slidecontroller.py (+1/-1)
openlp/plugins/songs/forms/editsongform.py (+34/-38)
openlp/plugins/songs/forms/mediafilesform.py (+11/-4)
openlp/plugins/songs/forms/songexportform.py (+13/-29)
openlp/plugins/songs/forms/songimportform.py (+43/-68)
openlp/plugins/songs/lib/__init__.py (+5/-5)
openlp/plugins/songs/lib/db.py (+5/-4)
openlp/plugins/songs/lib/importers/cclifile.py (+27/-31)
openlp/plugins/songs/lib/importers/chordpro.py (+3/-4)
openlp/plugins/songs/lib/importers/dreambeam.py (+10/-8)
openlp/plugins/songs/lib/importers/easyslides.py (+1/-1)
openlp/plugins/songs/lib/importers/easyworship.py (+30/-46)
openlp/plugins/songs/lib/importers/foilpresenter.py (+2/-5)
openlp/plugins/songs/lib/importers/lyrix.py (+3/-4)
openlp/plugins/songs/lib/importers/openlp.py (+1/-1)
openlp/plugins/songs/lib/importers/openlyrics.py (+2/-5)
openlp/plugins/songs/lib/importers/openoffice.py (+5/-12)
openlp/plugins/songs/lib/importers/opensong.py (+3/-5)
openlp/plugins/songs/lib/importers/opspro.py (+9/-10)
openlp/plugins/songs/lib/importers/powerpraise.py (+4/-6)
openlp/plugins/songs/lib/importers/powersong.py (+7/-3)
openlp/plugins/songs/lib/importers/presentationmanager.py (+11/-11)
openlp/plugins/songs/lib/importers/propresenter.py (+11/-9)
openlp/plugins/songs/lib/importers/songbeamer.py (+14/-14)
openlp/plugins/songs/lib/importers/songimport.py (+26/-27)
openlp/plugins/songs/lib/importers/songpro.py (+3/-1)
openlp/plugins/songs/lib/importers/songshowplus.py (+84/-87)
openlp/plugins/songs/lib/importers/sundayplus.py (+3/-7)
openlp/plugins/songs/lib/importers/videopsalm.py (+8/-9)
openlp/plugins/songs/lib/importers/wordsofworship.py (+55/-56)
openlp/plugins/songs/lib/importers/worshipassistant.py (+11/-15)
openlp/plugins/songs/lib/importers/zionworx.py (+1/-1)
openlp/plugins/songs/lib/mediaitem.py (+16/-18)
openlp/plugins/songs/lib/openlyricsexport.py (+10/-9)
openlp/plugins/songs/lib/upgrade.py (+31/-2)
openlp/plugins/songs/reporting.py (+2/-3)
openlp/plugins/songs/songsplugin.py (+1/-3)
tests/functional/openlp_plugins/images/test_upgrade.py (+1/-0)
tests/functional/openlp_plugins/songs/test_chordproimport.py (+3/-1)
tests/functional/openlp_plugins/songs/test_easyslidesimport.py (+4/-3)
tests/functional/openlp_plugins/songs/test_ewimport.py (+35/-54)
tests/functional/openlp_plugins/songs/test_lyriximport.py (+5/-4)
tests/functional/openlp_plugins/songs/test_mediashout.py (+6/-6)
tests/functional/openlp_plugins/songs/test_openlpimporter.py (+2/-2)
tests/functional/openlp_plugins/songs/test_openlyricsexport.py (+10/-8)
tests/functional/openlp_plugins/songs/test_openlyricsimport.py (+5/-4)
tests/functional/openlp_plugins/songs/test_openoffice.py (+2/-2)
tests/functional/openlp_plugins/songs/test_opensongimport.py (+9/-8)
tests/functional/openlp_plugins/songs/test_opsproimport.py (+5/-5)
tests/functional/openlp_plugins/songs/test_powerpraiseimport.py (+4/-3)
tests/functional/openlp_plugins/songs/test_presentationmanagerimport.py (+4/-3)
tests/functional/openlp_plugins/songs/test_propresenterimport.py (+5/-4)
tests/functional/openlp_plugins/songs/test_songbeamerimport.py (+8/-7)
tests/functional/openlp_plugins/songs/test_songproimport.py (+3/-2)
tests/functional/openlp_plugins/songs/test_songselect.py (+4/-3)
tests/functional/openlp_plugins/songs/test_songshowplusimport.py (+10/-9)
tests/functional/openlp_plugins/songs/test_sundayplusimport.py (+3/-1)
tests/functional/openlp_plugins/songs/test_videopsalm.py (+4/-3)
tests/functional/openlp_plugins/songs/test_wordsofworshipimport.py (+5/-4)
tests/functional/openlp_plugins/songs/test_worshipassistantimport.py (+5/-4)
tests/functional/openlp_plugins/songs/test_worshipcenterproimport.py (+3/-3)
tests/functional/openlp_plugins/songs/test_zionworximport.py (+4/-3)
tests/helpers/songfileimport.py (+1/-1)
Changed in openlp: | |
status: | New → Fix Committed |
Changed in openlp: | |
milestone: | none → 2.9.1 |
Also causes inability to save service lists if media files (with wrong paths) are included.