slightly refactor loading of Planning Center services#1580
slightly refactor loading of Planning Center services#1580vassbo merged 1 commit intoChurchApps:devfrom De-Fontein:dev
Conversation
| Cool, looks good. The numbers are added because by the looks of it Planning Center are setting a different ID to the songs when they are in different services, even though they are the same. Because of that the file names can't be the same in FreeShow becuase that does not work with the file system, so a fix would be to mark all imported Planning Center songs with a origin source as "PCO" or something, so we can on each sync check all songs with that mark and with the same name; if it's the same content, we replace the project id by the existing one and don't import the new song that is identical. |
| Thanks, that explanation really helps. I’ll try it out today and see if that is indeed the issue :) |
| Just checked it, Planning Center uses IDs for the items, these are always unique. But they do link to songs, so maybe I can just use a combination of the song ID, Arrangement ID, and Key (to prevent overriding different keys/arrangements of the same song). Another fix might be to use directories per service plan to store the files, but not sure how difficult that would be to implement (because idk how FreeShow currently handles files). |
| All the .show files are stored in the same folder and I don't see any good reason to change that. (It definetly breaks more things than it fixes) If it's the same song, but a different arrangement we can create a new layout in the existing show with the same name. |
| That makes sense, I wouldn't make a change in the directory structure then. I like the idea of using a "show" for a "song" and "layouts" for "arrangements", keys are not really relevant for lyrics anyways. I'll do some tests :) |
| I added the origin key now, so all Planning Center songs will be marked with the key |
* fix 'source' in snapcraft.yaml (#1560) Since `snapcraft` must be run from the root and since `snapcraft.yaml` must be in the `snap` directory of the root (accommodated by the `makesnap` script), the double-parent sourcing should not be used. * Sync Song Library to Chums (#1567) * Updated to new dev branch * Refactored to classes * Refactored to static methods * Only send missing shows to be imported * Added comments * Formatted missing request correctly * Added groups * Switched to production * 🖼️ Copy and paste media filters/style - Fixed a .pro import issue - Next slide timer preview not jumping out between slides - OpenLP should now import chords - Transpose active show action - Fixed resetting shadow not working - NowPlaying file prioritized metadata title before file name - Audio metadata is now sent to the output window - Audio dynamic values conditions should now update - Fixed a freeze with broken project file - Updated Chinese language - Formatting and linting * 🎨 Prettier formatting * 🎨 Prettier formatting * slightly refactor loading of Planning Center services (#1580) * 📄 Show origin key value - Hold shift when dropping action to make it override - Updated languages * fix duplicate shows from Planning Center items (#1582) * fix duplicate shows from Planning Center items * simplify the fix * ✨ Companion talk updates - Slide notes tweaks - Fixed web stage dynamic values flashing when empty - Recently used projects reduced from a week to five days - Fixed a freeze issue * 🕑 Audio/video/timer seek to time API action - Playing audio time dynamic values * 📱 Edit project from RemoteShow - Search for scripture in RemoteShow - Updated NowPlaying.txt file contents - Option to always show the projects list on startup - Copy/paste project items - Stage conditions text check working for scripture - Fixed "Run action" added from template not removable - Fixed actions added from template not removable from context menu * ✨ Quick search now works for navigating through lots of menus - Conditions based on timer value - Fixed output style lines not always matching other outputs - Fixed output window lines not always mathing correct preview lines - Version update --------- Co-authored-by: Erich Eickmeyer <erich@ericheickmeyer.com> Co-authored-by: Jeremy Zongker <jeremy@zongker.net> Co-authored-by: Auxority <35202343+Auxority@users.noreply.github.com>
* fix 'source' in snapcraft.yaml (ChurchApps#1560) Since `snapcraft` must be run from the root and since `snapcraft.yaml` must be in the `snap` directory of the root (accommodated by the `makesnap` script), the double-parent sourcing should not be used. * Sync Song Library to Chums (ChurchApps#1567) * Updated to new dev branch * Refactored to classes * Refactored to static methods * Only send missing shows to be imported * Added comments * Formatted missing request correctly * Added groups * Switched to production * 🖼️ Copy and paste media filters/style - Fixed a .pro import issue - Next slide timer preview not jumping out between slides - OpenLP should now import chords - Transpose active show action - Fixed resetting shadow not working - NowPlaying file prioritized metadata title before file name - Audio metadata is now sent to the output window - Audio dynamic values conditions should now update - Fixed a freeze with broken project file - Updated Chinese language - Formatting and linting * 🎨 Prettier formatting * 🎨 Prettier formatting * slightly refactor loading of Planning Center services (ChurchApps#1580) * 📄 Show origin key value - Hold shift when dropping action to make it override - Updated languages * fix duplicate shows from Planning Center items (ChurchApps#1582) * fix duplicate shows from Planning Center items * simplify the fix * ✨ Companion talk updates - Slide notes tweaks - Fixed web stage dynamic values flashing when empty - Recently used projects reduced from a week to five days - Fixed a freeze issue * 🕑 Audio/video/timer seek to time API action - Playing audio time dynamic values * 📱 Edit project from RemoteShow - Search for scripture in RemoteShow - Updated NowPlaying.txt file contents - Option to always show the projects list on startup - Copy/paste project items - Stage conditions text check working for scripture - Fixed "Run action" added from template not removable - Fixed actions added from template not removable from context menu * ✨ Quick search now works for navigating through lots of menus - Conditions based on timer value - Fixed output style lines not always matching other outputs - Fixed output window lines not always mathing correct preview lines - Version update --------- Co-authored-by: Erich Eickmeyer <erich@ericheickmeyer.com> Co-authored-by: Jeremy Zongker <jeremy@zongker.net> Co-authored-by: Auxority <35202343+Auxority@users.noreply.github.com>
Hey there, just thought it would be nice to apply some slight refactoring here to make it easier to maintain.
I was attempting to fix an issue, but wasn't able to figure it out. Maybe someone with more knowledge on the project can help out. For some reason items/songs with the same name are suffixed with a number, even though they are in different Planning Center Plans / FreeShow shows.
The first import goes perfectly fine:

Second one has one minor issue:

But a service with the same template gets quite messy:

If anyone can hint me in the right direction I am more than happy to create a PR for a fix.