1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-09-02 02:12:45 +02:00

Fixed minor issue where if a user didn't exist tumblr ripper would output error message twice

This commit is contained in:
cyian-1756
2018-11-27 14:08:09 -05:00
parent 5c6edbcd4d
commit ddeb5b6b88

View File

@@ -130,7 +130,8 @@ public class TumblrRipper extends AlbumRipper {
@Override @Override
public void rip() throws IOException { public void rip() throws IOException {
String[] mediaTypes; String[] mediaTypes;
boolean exceededRateLimit = false; // If true the rip loop won't be run
boolean shouldStopRipping = false;
if (albumType == ALBUM_TYPE.POST) { if (albumType == ALBUM_TYPE.POST) {
mediaTypes = new String[] { "post" }; mediaTypes = new String[] { "post" };
} else { } else {
@@ -142,7 +143,7 @@ public class TumblrRipper extends AlbumRipper {
break; break;
} }
if (exceededRateLimit) { if (shouldStopRipping) {
break; break;
} }
offset = 0; offset = 0;
@@ -151,7 +152,7 @@ public class TumblrRipper extends AlbumRipper {
break; break;
} }
if (exceededRateLimit) { if (shouldStopRipping) {
break; break;
} }
@@ -174,11 +175,12 @@ public class TumblrRipper extends AlbumRipper {
} else if (status.getStatusCode() == 404) { } else if (status.getStatusCode() == 404) {
LOGGER.error("No user or album found!"); LOGGER.error("No user or album found!");
sendUpdate(STATUS.NO_ALBUM_OR_USER, "Album or user doesn't exist!"); sendUpdate(STATUS.NO_ALBUM_OR_USER, "Album or user doesn't exist!");
shouldStopRipping = true;
break; break;
} else if (status.getStatusCode() == 429) { } else if (status.getStatusCode() == 429) {
LOGGER.error("Tumblr rate limit has been exceeded"); LOGGER.error("Tumblr rate limit has been exceeded");
sendUpdate(STATUS.DOWNLOAD_ERRORED,"Tumblr rate limit has been exceeded"); sendUpdate(STATUS.DOWNLOAD_ERRORED,"Tumblr rate limit has been exceeded");
exceededRateLimit = true; shouldStopRipping = true;
break; break;
} }
} }