39 lines
3.3 KiB
Markdown
39 lines
3.3 KiB
Markdown
# Download Songs and Create Playlist for your upcoming Planning Center Service
|
|
|
|
<------ THIS IS UNDER ACTIVE DEVELOPMENT AND NOT EVERYTHING HAS BEEN TESTED. I'VE BEEN PUSHING COMMITS AS I GO TO ENSURE I CAN ROLL BACK TO A WORKING COMMIT ---------->
|
|
|
|
## Background and Reasoning
|
|
|
|
Honestly, this thing may be overkill. But I'm into DIY and Self-Hosted stuff and I listen to a lot of my music from my local machine/server using Navidrome & Music Assistant. Instead of opening PCO every time I want to listen to music
|
|
casually - not practice - I want the music to be in the app that I'm already using.
|
|
This has been tested on Unix systems (built on Mac, Music Assistant server on Linux), so I am not sure if this will work at all on Windows.
|
|
|
|
## How to set up
|
|
1. Login to [PLanning Center's Developer Account](https://api.planningcenteronline.com/oauth/applications).
|
|
2. Create a Personal Access Token as this is just for you and you may also not be an Org Admin.
|
|
4. Enter your Client ID and Secret into the `.env` file under appropriate variables.
|
|
5. On your machine of choice either [build from source](#buildfromsource) or [run in a Docker container](#docker).
|
|
|
|
|
|
## Build from Source
|
|
COMING SOON
|
|
|
|
## Docker
|
|
COMING SOON
|
|
|
|
## Key things to Consider! Important!
|
|
I don't work for a church nor have admin access to a PCO organization. I am just on the worship team. That means there are some key things that my church does that yours may not.
|
|
* When looking for media attachments, there are a few `filetype` values that can be present. This application is just looking for `audio` within that value. If your church uses something different, please open an issue or create a PR if you'd like to contribute to this yourself.
|
|
* I am one person so I am just looking for one user in PCO! (See `env.example` file)
|
|
* There is this value in the attachments payload: `services.Plan.Attachments.attributes.allow_mp3_download`. If an attachment is not an audio file type (i.e Chord Charts), then the value is `False` and I'm skipping over it. I don't plan on adding functionality for downloading other file types.
|
|
* The application is checking if the incoming webhook's `service_id` and `plan_id` exist under the `services.PlanPerson` object. In other words, if you are part of a service and plan in PCO and the plan was updated, the application will continue running. There is no current functionality to grab files from plans or services you're not part of.
|
|
* That being said, I did some testing with non-user specific services and plans, so I may add that as a boolean.
|
|
* Recently, my church has begun inserting instrument-specific rehearsal tracks. I've added an `.env` variable (`ALLFILESBOOL`) that you can use if you'd like to download all the rehearsal tracks or just the main/full-band track.
|
|
* Please leave that boolean to True. False isn't quite working yet as there seems to be little consistency in file names and my church isn't using `attachment_types`.
|
|
* I tested this with the few payload types that could apply to my use-case. If there are other unique use-cases that apply to you, please open an issue and I'm happy to try and include it. My tests were:
|
|
* My service in `PlanPerson` without attachments
|
|
* My service in `PlanPerson` with attachments
|
|
* My service in `PlanPerson` with future plan
|
|
* My service in `PlanPerson` with past plan
|
|
* My service not in `PlanPerson`
|