Delete downsized and uploaded cache files

This commit is contained in:
kyori19 2020-08-29 13:56:42 +09:00
parent e4ebfa581d
commit c0079e29fd
1 changed files with 6 additions and 0 deletions

View File

@ -175,6 +175,12 @@ class MediaUploaderImpl(
val uploadDisposable = mastodonApi.uploadMedia(body)
.subscribe({ attachment ->
if (media.uri.scheme == "file") {
media.uri.path?.let {
File(it).delete()
}
}
emitter.onNext(UploadEvent.FinishedEvent(attachment))
emitter.onComplete()
}, { e ->