caronc / apprise

Apprise - Push Notifications that work with just about every platform!
https://hub.docker.com/r/caronc/apprise
BSD 2-Clause "Simplified" License
10.9k stars 384 forks source link

Add parameter to send just one of multiple attachments when using Pushover plugin #1092

Closed pomeloy closed 2 months ago

pomeloy commented 3 months ago

Description:

Related issue (if applicable): #1091

Checklist

Testing

Anyone can help test this source code as follows:

# Create a virtual environment to work in as follows:
python3 -m venv apprise

# Change into our new directory
cd apprise

# Activate our virtual environment
source bin/activate

# Install the branch
pip install git+git@github.com:pomeloy/apprise.git@pushover_attachments

# Test out the changes with the following command:
apprise -t "Test Title" -b "Test Message" --attach "test/var/apprise-test.jpeg" --attach "test/var/apprise-test.gif" --multiple_attachments False "pover://{user_key}@{token}/?multiple_attachments=False"
caronc commented 2 months ago

Does ?overflow=truncate not accomplish this?

pomeloy commented 2 months ago

I totally overlooked that option. Still, it does not accomplish this because overflow only gets applied to the title and body of a given message right now while I need to limit the attachment count.

While using the overflow option for this feature request might be the best way to implement this, I am struggling to find a way to make this work with the SPLIT overflow option as is right now as I am not sure what a split message should look like when both body and attachment count are too high for a given notification service.

Also, I haven't had the time to manually check which notification providers apart from Pushover do support attachments while allowing to send only one at a time so I don't know whether a plugin-agnostic way is really needed.

caronc commented 2 months ago

I think overflow should be updated to handle this (more globally) and to your point, there is a use case to not spam messages on a per notification basis

Edit: I can have a look this weekend. I think the fix to this is to just make the overflow directive available (like the secure and timeout options already are). That way it can be referenced. Split and upstream settings would simply be treated the same.