Skip to content

Commit 96dc31b

Browse files
committed
fixes
1 parent b5254fb commit 96dc31b

35 files changed

Lines changed: 649 additions & 36 deletions

src/main/java/dev/katsute/civitai/Civitai.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright (C) 2026 Katsute <https://github.com/Katsute>
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 2 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License along
15+
* with this program; if not, write to the Free Software Foundation, Inc.,
16+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17+
*/
18+
119
package dev.katsute.civitai;
220

321
import dev.katsute.civitai.model.Model;
@@ -53,4 +71,4 @@ public static Civitai authenticate(final String token){
5371

5472
public abstract boolean cancelJob(final String id);
5573

56-
}
74+
}

src/main/java/dev/katsute/civitai/CivitaiObjectService.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright (C) 2026 Katsute <https://github.com/Katsute>
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 2 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License along
15+
* with this program; if not, write to the Free Software Foundation, Inc.,
16+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17+
*/
18+
119
package dev.katsute.civitai;
220

321
import dev.katsute.civitai.Json.JsonObject;
@@ -83,4 +101,4 @@ public final int getModelCount() {
83101
};
84102
}
85103

86-
}
104+
}

src/main/java/dev/katsute/civitai/CivitaiService.java

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright (C) 2026 Katsute <https://github.com/Katsute>
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 2 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License along
15+
* with this program; if not, write to the Free Software Foundation, Inc.,
16+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17+
*/
18+
119
package dev.katsute.civitai;
220

321
import java.io.BufferedReader;
@@ -677,23 +695,23 @@ private final Map<String,String> map(final String... args){
677695
}
678696

679697
private final Response request(final String url){
680-
return request(url, "GET", Map.of());
698+
return request(url, "GET", null);
681699
}
682700

683701
private final Response request(final String url, final Map<String,String> params){
684702
return request(url, "GET", params);
685703
}
686704

687705
private final Response request(final String url, final String method){
688-
return request(url, method, Map.of());
706+
return request(url, method, null);
689707
}
690708

691709
private final Response request(final String url, final String method, final Map<String,String> params){
692710
HttpURLConnection conn;
693711
try {
694712
final String URL =
695713
url +
696-
(params.isEmpty() ? "" : '?' +
714+
(params == null || params.isEmpty() ? "" : '?' +
697715
params
698716
.entrySet()
699717
.stream()
@@ -766,4 +784,4 @@ private Response handleResponseCodes(final ThrowableSupplier<Response,IOExceptio
766784
}
767785
}
768786

769-
}
787+
}

src/main/java/dev/katsute/civitai/Creator.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright (C) 2026 Katsute <https://github.com/Katsute>
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 2 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License along
15+
* with this program; if not, write to the Free Software Foundation, Inc.,
16+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17+
*/
18+
119
package dev.katsute.civitai;
220

321
import dev.katsute.civitai.image.Image;
@@ -19,4 +37,4 @@ public abstract class Creator {
1937

2038
public abstract Page<Image> getImages();
2139

22-
}
40+
}

src/main/java/dev/katsute/civitai/Page.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright (C) 2026 Katsute <https://github.com/Katsute>
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 2 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License along
15+
* with this program; if not, write to the Free Software Foundation, Inc.,
16+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17+
*/
18+
119
package dev.katsute.civitai;
220

321
import java.util.ArrayList;
@@ -71,4 +89,4 @@ public final List<T> toList(){
7189
return new ArrayList<>(list);
7290
}
7391

74-
}
92+
}

src/main/java/dev/katsute/civitai/Regex9.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,24 @@
1616
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1717
*/
1818

19+
/*
20+
* Copyright (C) 2026 Katsute <https://github.com/Katsute>
21+
*
22+
* This program is free software; you can redistribute it and/or modify
23+
* it under the terms of the GNU General Public License as published by
24+
* the Free Software Foundation; either version 2 of the License, or
25+
* (at your option) any later version.
26+
*
27+
* This program is distributed in the hope that it will be useful,
28+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
29+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30+
* GNU General Public License for more details.
31+
*
32+
* You should have received a copy of the GNU General Public License along
33+
* with this program; if not, write to the Free Software Foundation, Inc.,
34+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
35+
*/
36+
1937
package dev.katsute.civitai;
2038

2139
import java.util.Objects;

src/main/java/dev/katsute/civitai/generate/AIResource.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright (C) 2026 Katsute <https://github.com/Katsute>
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 2 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License along
15+
* with this program; if not, write to the Free Software Foundation, Inc.,
16+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17+
*/
18+
119
package dev.katsute.civitai.generate;
220

321
public class AIResource {
@@ -62,4 +80,4 @@ public final String toString() {
6280
'}';
6381
}
6482

65-
}
83+
}

src/main/java/dev/katsute/civitai/generate/MalformedResourceException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ public final class MalformedResourceException extends RuntimeException {
3232
super(message);
3333
}
3434

35-
}
35+
}

src/main/java/dev/katsute/civitai/generate/Scheduler.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright (C) 2026 Katsute <https://github.com/Katsute>
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 2 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License along
15+
* with this program; if not, write to the Free Software Foundation, Inc.,
16+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17+
*/
18+
119
package dev.katsute.civitai.generate;
220

321
public enum Scheduler {
@@ -42,4 +60,4 @@ public final String toString() {
4260
return name();
4361
}
4462

45-
}
63+
}

src/main/java/dev/katsute/civitai/image/Image.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright (C) 2026 Katsute <https://github.com/Katsute>
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 2 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License along
15+
* with this program; if not, write to the Free Software Foundation, Inc.,
16+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17+
*/
18+
119
package dev.katsute.civitai.image;
220

321
import java.util.Date;
@@ -45,4 +63,4 @@ public abstract class Stats {
4563

4664
}
4765

48-
}
66+
}

0 commit comments

Comments
 (0)