dshoreman / nextshot

A simple tool for taking screenshots on Linux and sharing via Nextcloud
GNU General Public License v2.0
42 stars 3 forks source link

Uploading duplicate files doesn't return link #50

Closed dshoreman closed 5 years ago

dshoreman commented 5 years ago

When uploading an image that already exists in Nextcloud, either by renaming a screenshot or by using the --file option, Nextcloud returns a 204 response code.

Need to do some more testing to see whether this overwrites or simply fails without doing anything. If it does overwrite it could simply be a matter of adding 204 to the checked responses and sharing anyway.

If it fails, we should rename the file (e.g. append -1, -2 etc.) and retry. That said, it may be better to check if the file exists first and automatically rename regardless of whether it overwrites or not.

dshoreman commented 5 years ago

Fixed in v1.2.1