DumbDrop icon indicating copy to clipboard operation
DumbDrop copied to clipboard

Include file size in the notification

Open csjoh opened this issue 1 year ago • 5 comments

Add environment variables to include the file size in the notification sent, like this:

APPRISE_FILESIZE="{filesize}" APPRISE_FILESIZE_UNIT="K"

Options are K, M, G, T for Kilobytes, Megabytes, Gigabytes and Terabytes, respectively. Add "B" after the UNIT letter when UNIT is not B. Default should be the nearest smallest number and unit, so if a file of 5.4GB is uploaded, present it as 5.4GB. If a file of 1,474,560 bytes is uploaded, present it as 1.44MB. If a 262,144 byte file is uploaded, present it as 256KB, and so on. I'm using 1024 for 1KB here.

Examples:

Kilobytes: File uploaded: BigFile.mkv (5 662 310 KB)

Megabytes: File uploaded: BigFile.mkv (5 529 MB)

Gigabytes: File uploaded: BigFile.mkv (5.4 GB)

Terabytes: File uploaded: TheInternet.zip (1 124 532 563 TB) 😄

csjoh avatar Jan 31 '25 23:01 csjoh

@greirson Not sure if this is something you wanted to look at. If not I can look at implementing at a later date.

abiteman avatar Jan 31 '25 23:01 abiteman

@greirson Not sure if this is something you wanted to look at. If not I can look at implementing at a later date.

@abiteman I'll take a crack at it if you want to assign this one over to me. Shouldn't be to much to implement.

greirson avatar Feb 01 '25 04:02 greirson

Thanks!

abiteman avatar Feb 01 '25 04:02 abiteman

Pushed with https://github.com/DumbWareio/DumbDrop/pull/16, Great idea @csjoh

I also added {storage} as an option to output the TOTAL amount of storage in use in the upload folder

greirson avatar Feb 01 '25 05:02 greirson

Great work @greirson thank you!

Fo shizzle

abiteman avatar Feb 01 '25 06:02 abiteman