Compare commits

..

4 Commits
1.5 ... master

Author SHA1 Message Date
Roman Pedchenko
f16e8ff7da
- fixed version 2020-02-27 16:12:01 +02:00
Roman Pedchenko
2f14392e1e
Merge pull request #11 from billlhead/master
Fixes errors with loading issues without limits and searching for issues containing white spaces
2020-02-27 16:06:56 +02:00
Bill Kachirsky
1f7fcd7d03 Encode query string to fix problems of searching for issues with a whitespace in it. 2020-02-27 01:54:52 -08:00
Bill Kachirsky
e5e3e84b23 Fix error of only loading one issue if no limit (-1) is set. 2020-02-27 01:48:56 -08:00
2 changed files with 11 additions and 8 deletions

View File

@ -1,11 +1,11 @@
<!--
~ Copyright © 2019 by elfuego.biz
~ Copyright © 2020 by elfuego.biz
-->
<idea-plugin>
<id>biz.elfuego.idea.issues.gitea</id>
<name>Gitea issues</name>
<version>1.5</version>
<version>1.6</version>
<vendor email="support@elfuego.biz" url="http://elfuego.biz">elfuego.biz</vendor>
<description><![CDATA[
@ -13,8 +13,8 @@
]]></description>
<change-notes><![CDATA[
Added offset/limit processing.<br>
Implemented 'assigned to me' filter.<br>
Fixes errors with loading issues without limits (contributed by billlhead).<br>
Fixes searching for issues containing white spaces (contributed by billlhead).<br>
]]>
</change-notes>

View File

@ -30,6 +30,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.InputStreamReader;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.function.Function;
@ -260,7 +261,7 @@ class GiteaRepository extends BaseRepositoryImpl {
StringBuilder qu = new StringBuilder();
if (query != null)
qu.append("?q=").append(query);
qu.append("?q=").append(URLEncoder.encode(query, "UTF-8"));
if (withClosed)
qu.append("&state=closed");
qu.append("&page=");
@ -296,9 +297,11 @@ class GiteaRepository extends BaseRepositoryImpl {
continue;
GiteaTaskImpl mapped = new GiteaTaskImpl(this, raw);
result.add(mapped);
limit--;
if (limit < 1)
return false;
if (limit > -1) {
limit--;
if (limit < 1)
return false;
}
}
return true;
}