mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 13:19:02 +00:00
(sideload) Fix filename error in dealing with stackoverflow files
This commit is contained in:
parent
eadcdb5bed
commit
c6313a5906
@ -74,15 +74,15 @@ public class StackExchangeSideloadHelper {
|
|||||||
|
|
||||||
private static Optional<String> getStackexchangeDomainFromFilename(String fileName) {
|
private static Optional<String> getStackexchangeDomainFromFilename(String fileName) {
|
||||||
// We are only interested in .tld.7z files
|
// We are only interested in .tld.7z files
|
||||||
if (!fileName.endsWith(".7z") && fileName.length() > 7)
|
if (!fileName.endsWith(".7z") || fileName.length() < 7)
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
|
|
||||||
|
|
||||||
// Stackoverflow is special, because it has one 7z file per site
|
// Stackoverflow is special, because it has one 7z file per site
|
||||||
// (we only want Posts)
|
// (we only want Posts)
|
||||||
|
|
||||||
if (fileName.equals("stackoverflow-Posts.7z"))
|
if (fileName.equals("stackoverflow.com-Posts.7z"))
|
||||||
return Optional.of("stackoverflow.com");
|
return Optional.of("www.stackoverflow.com");
|
||||||
else if (fileName.startsWith("stackoverflow.com-")) {
|
else if (fileName.startsWith("stackoverflow.com-")) {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user