Avoid duplicate video errors. (#300)

This commit is contained in:
Kavin 2022-07-04 06:02:06 +01:00 committed by GitHub
parent c8628dcf05
commit cdd8a962d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,8 +64,10 @@ public class ServerLauncher extends MultithreadedHttpServerLauncher {
Multithreading.runAsync(() -> {
for (var entry : feed.getEntries()) {
ResponseHelper.handleNewVideo(entry.getLinks().get(0).getHref(),
entry.getPublishedDate().getTime(), null);
String url = entry.getLinks().get(0).getHref();
if (DatabaseHelper.getVideoFromId(StringUtils.substring(url, -11)) != null)
continue;
ResponseHelper.handleNewVideo(url, entry.getPublishedDate().getTime(), null);
}
});