e621_export_downloader 0.0.15 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +81 -0
- data/lib/e621/artist.rb +2 -1
- data/lib/e621/bulk_update_request.rb +3 -0
- data/lib/e621/post.rb +32 -29
- data/lib/e621/tag_alias.rb +10 -0
- data/lib/e621/tag_implication.rb +15 -5
- data/lib/e621/wiki_page.rb +1 -0
- data/lib/e621_export_downloader/models/artist.rb +10 -5
- data/lib/e621_export_downloader/models/bulk_update_request.rb +15 -0
- data/lib/e621_export_downloader/models/post.rb +73 -58
- data/lib/e621_export_downloader/models/tag_alias.rb +54 -4
- data/lib/e621_export_downloader/models/tag_implication.rb +60 -9
- data/lib/e621_export_downloader/models/wiki_page.rb +6 -1
- data/lib/e621_export_downloader/version.rb +1 -1
- data/lib/generators/e621_export_downloader/templates/migrations/create_e621_tables.rb.erb +85 -85
- data/scripts/generate_changelog.rb +50 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6d58e880077e657ef28542f3873a57f6b2759c2dc5cc3ace7b39b0b016134b1d
|
|
4
|
+
data.tar.gz: 93ba667cb1a85c203cf861aeedfc36ae4ba8dffeb9bc50c08df275a8ccd27844
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: af0d7f73fc67b9c2a291ca5c8de1e200dcd09e42ddf31d4c40fb07938a1f25a13b428dff8ad6e3a44190b6b2c3a672991d8f5b9a40aed2e808286512bf60812e
|
|
7
|
+
data.tar.gz: c012e57c2fc91e8d3991f47eb59842947a81acad6137a52f1ad768b8dcaeeb9990b13ffdad5d8d6c398a9dd6ba768928183163af14670398ce78b7874ccdf99b
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.0.17] - 2026-06-29
|
|
4
|
+
|
|
5
|
+
_0.0.17_
|
|
6
|
+
|
|
7
|
+
## [0.0.16] - 2026-06-24
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- Add new dbexport fields (from: e621ng/e621ng#2181, pending: e621ng/e621ng#2222)
|
|
11
|
+
|
|
12
|
+
## [0.0.15] - 2026-06-14
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- Add method to track download progress
|
|
16
|
+
|
|
17
|
+
## [0.0.14] - 2026-06-14
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- optimize csv import
|
|
21
|
+
|
|
22
|
+
## [0.0.13] - 2026-06-13
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
- Add stored row count & text indexes
|
|
26
|
+
|
|
27
|
+
## [0.0.12] - 2026-06-12
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
- Fix post versions missing post_id
|
|
31
|
+
|
|
32
|
+
## [0.0.11] - 2026-06-12
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
- Fix csv import
|
|
36
|
+
|
|
37
|
+
## [0.0.10] - 2026-06-12
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
- Fix models
|
|
41
|
+
|
|
42
|
+
## [0.0.9] - 2026-06-12
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
- Fix parsing
|
|
46
|
+
|
|
47
|
+
## [0.0.8] - 2026-06-12
|
|
48
|
+
|
|
49
|
+
### Added
|
|
50
|
+
- Add csv import function to models
|
|
51
|
+
|
|
52
|
+
## [0.0.7] - 2026-06-12
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
- Fix railtie
|
|
56
|
+
|
|
57
|
+
## [0.0.6] - 2026-06-12
|
|
58
|
+
|
|
59
|
+
_Rails Migration & models_
|
|
60
|
+
|
|
61
|
+
## [0.0.5] - 2026-06-12
|
|
62
|
+
|
|
63
|
+
_force republish_
|
|
64
|
+
|
|
65
|
+
## [0.0.4] - 2026-06-12
|
|
66
|
+
|
|
67
|
+
_db export changes_
|
|
68
|
+
|
|
69
|
+
## [0.0.3] - 2026-05-19
|
|
70
|
+
|
|
71
|
+
### Added
|
|
72
|
+
- Add activejob serializer
|
|
73
|
+
|
|
74
|
+
## [0.0.2] - 2026-05-05
|
|
75
|
+
|
|
76
|
+
### Fixed
|
|
77
|
+
- Fix Types serialization
|
|
78
|
+
|
|
79
|
+
## [0.0.1] - 2026-05-05
|
|
80
|
+
|
|
81
|
+
_Initial Commit_
|
data/lib/e621/artist.rb
CHANGED
|
@@ -25,16 +25,17 @@ module E621
|
|
|
25
25
|
private_class_method(def self.attributes_from_export(record)
|
|
26
26
|
{
|
|
27
27
|
id: record.id,
|
|
28
|
+
active_urls: record.active_urls,
|
|
28
29
|
created_at: record.created_at,
|
|
29
30
|
creator_id: record.creator_id,
|
|
30
31
|
group_name: record.group_name,
|
|
32
|
+
inactive_urls: record.inactive_urls,
|
|
31
33
|
is_active: record.is_active,
|
|
32
34
|
is_locked: record.is_locked,
|
|
33
35
|
linked_user_id: record.linked_user_id,
|
|
34
36
|
name: record.name,
|
|
35
37
|
other_names: record.other_names,
|
|
36
38
|
updated_at: record.updated_at,
|
|
37
|
-
urls: record.urls,
|
|
38
39
|
}
|
|
39
40
|
end)
|
|
40
41
|
end
|
|
@@ -27,10 +27,13 @@ module E621
|
|
|
27
27
|
id: record.id,
|
|
28
28
|
approver_id: record.approver_id,
|
|
29
29
|
created_at: record.created_at,
|
|
30
|
+
down_votes: record.down_votes,
|
|
30
31
|
forum_topic_id: record.forum_topic_id,
|
|
32
|
+
meh_votes: record.meh_votes,
|
|
31
33
|
script: record.script,
|
|
32
34
|
status: record.status,
|
|
33
35
|
title: record.title,
|
|
36
|
+
up_votes: record.up_votes,
|
|
34
37
|
updated_at: record.updated_at,
|
|
35
38
|
user_id: record.user_id,
|
|
36
39
|
}
|
data/lib/e621/post.rb
CHANGED
|
@@ -24,35 +24,38 @@ module E621
|
|
|
24
24
|
|
|
25
25
|
private_class_method(def self.attributes_from_export(record)
|
|
26
26
|
{
|
|
27
|
-
id:
|
|
28
|
-
approver_id:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
27
|
+
id: record.id,
|
|
28
|
+
approver_id: record.approver_id,
|
|
29
|
+
bg_color: record.bg_color,
|
|
30
|
+
change_seq: record.change_seq,
|
|
31
|
+
comment_count: record.comment_count,
|
|
32
|
+
created_at: record.created_at,
|
|
33
|
+
description: record.description,
|
|
34
|
+
down_score: record.down_score,
|
|
35
|
+
duration: record.duration,
|
|
36
|
+
fav_count: record.fav_count,
|
|
37
|
+
file_ext: record.file_ext,
|
|
38
|
+
file_size: record.file_size,
|
|
39
|
+
image_height: record.image_height,
|
|
40
|
+
image_width: record.image_width,
|
|
41
|
+
is_deleted: record.is_deleted,
|
|
42
|
+
is_flagged: record.is_flagged,
|
|
43
|
+
is_note_locked: record.is_note_locked,
|
|
44
|
+
is_pending: record.is_pending,
|
|
45
|
+
is_rating_locked: record.is_rating_locked,
|
|
46
|
+
is_status_locked: record.is_status_locked,
|
|
47
|
+
last_commented_at: record.last_commented_at,
|
|
48
|
+
last_noted_at: record.last_noted_at,
|
|
49
|
+
locked_tags: record.locked_tags,
|
|
50
|
+
md5: record.md5,
|
|
51
|
+
parent_id: record.parent_id,
|
|
52
|
+
rating: record.rating,
|
|
53
|
+
score: record.score,
|
|
54
|
+
sources: record.sources,
|
|
55
|
+
tags: record.tags,
|
|
56
|
+
up_score: record.up_score,
|
|
57
|
+
updated_at: record.updated_at,
|
|
58
|
+
uploader_id: record.uploader_id,
|
|
56
59
|
}
|
|
57
60
|
end)
|
|
58
61
|
end
|
data/lib/e621/tag_alias.rb
CHANGED
|
@@ -26,9 +26,19 @@ module E621
|
|
|
26
26
|
{
|
|
27
27
|
id: record.id,
|
|
28
28
|
antecedent_name: record.antecedent_name,
|
|
29
|
+
approver_id: record.approver_id,
|
|
29
30
|
consequent_name: record.consequent_name,
|
|
30
31
|
created_at: record.created_at,
|
|
32
|
+
# creator_id: record.creator_id,
|
|
33
|
+
down_votes: record.down_votes,
|
|
34
|
+
forum_post_id: record.forum_post_id,
|
|
35
|
+
forum_topic_id: record.forum_topic_id,
|
|
36
|
+
meh_votes: record.meh_votes,
|
|
37
|
+
post_count: record.post_count,
|
|
38
|
+
reason: record.reason,
|
|
31
39
|
status: record.status,
|
|
40
|
+
up_votes: record.up_votes,
|
|
41
|
+
updated_at: record.updated_at,
|
|
32
42
|
}
|
|
33
43
|
end)
|
|
34
44
|
end
|
data/lib/e621/tag_implication.rb
CHANGED
|
@@ -24,11 +24,21 @@ module E621
|
|
|
24
24
|
|
|
25
25
|
private_class_method(def self.attributes_from_export(record)
|
|
26
26
|
{
|
|
27
|
-
id:
|
|
28
|
-
antecedent_name:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
id: record.id,
|
|
28
|
+
antecedent_name: record.antecedent_name,
|
|
29
|
+
approver_id: record.approver_id,
|
|
30
|
+
consequent_name: record.consequent_name,
|
|
31
|
+
created_at: record.created_at,
|
|
32
|
+
# creator_id: record.creator_id,
|
|
33
|
+
descendant_names: record.descendant_names,
|
|
34
|
+
down_votes: record.down_votes,
|
|
35
|
+
forum_post_id: record.forum_post_id,
|
|
36
|
+
forum_topic_id: record.forum_topic_id,
|
|
37
|
+
meh_votes: record.meh_votes,
|
|
38
|
+
reason: record.reason,
|
|
39
|
+
status: record.status,
|
|
40
|
+
up_votes: record.up_votes,
|
|
41
|
+
updated_at: record.updated_at,
|
|
32
42
|
}
|
|
33
43
|
end)
|
|
34
44
|
end
|
data/lib/e621/wiki_page.rb
CHANGED
|
@@ -6,6 +6,9 @@ module E621ExportDownloader
|
|
|
6
6
|
class Artist
|
|
7
7
|
extend(T::Sig)
|
|
8
8
|
|
|
9
|
+
sig { returns(T::Array[String]) }
|
|
10
|
+
attr_reader(:active_urls)
|
|
11
|
+
|
|
9
12
|
sig { returns(DateTime) }
|
|
10
13
|
attr_reader(:created_at)
|
|
11
14
|
|
|
@@ -18,6 +21,9 @@ module E621ExportDownloader
|
|
|
18
21
|
sig { returns(Integer) }
|
|
19
22
|
attr_reader(:id)
|
|
20
23
|
|
|
24
|
+
sig { returns(T::Array[String]) }
|
|
25
|
+
attr_reader(:inactive_urls)
|
|
26
|
+
|
|
21
27
|
sig { returns(T::Boolean) }
|
|
22
28
|
attr_reader(:is_active)
|
|
23
29
|
|
|
@@ -36,16 +42,15 @@ module E621ExportDownloader
|
|
|
36
42
|
sig { returns(DateTime) }
|
|
37
43
|
attr_reader(:updated_at)
|
|
38
44
|
|
|
39
|
-
sig { returns(T::Array[String]) }
|
|
40
|
-
attr_reader(:urls)
|
|
41
|
-
|
|
42
45
|
sig { params(record: T::Hash[String, String]).void }
|
|
43
46
|
def initialize(record)
|
|
44
47
|
@record = T.let(record, T::Hash[String, String])
|
|
48
|
+
@active_urls = T.let(T.must(record["active_urls"]).split("\n"), T::Array[String])
|
|
45
49
|
@created_at = T.let(DateTime.parse(record["created_at"]), DateTime)
|
|
46
50
|
@creator_id = T.let(record["creator_id"].to_i, Integer)
|
|
47
51
|
@group_name = T.let(T.must(record["group_name"]).empty? ? nil : record["group_name"], T.nilable(String))
|
|
48
52
|
@id = T.let(record["id"].to_i, Integer)
|
|
53
|
+
@inactive_urls = T.let(T.must(record["inactive_urls"]).split("\n"), T::Array[String])
|
|
49
54
|
@is_active = T.let(record["is_active"] == "t", T::Boolean)
|
|
50
55
|
@is_locked = T.let(record["is_locked"] == "t", T::Boolean)
|
|
51
56
|
@linked_user_id = T.let(T.must(record["linked_user_id"]).empty? ? nil : record["linked_user_id"].to_i, T.nilable(Integer))
|
|
@@ -53,23 +58,23 @@ module E621ExportDownloader
|
|
|
53
58
|
inner = T.must(T.must(record["other_names"])[1..-2])
|
|
54
59
|
@other_names = T.let(inner.empty? ? [] : inner.split(","), T::Array[String])
|
|
55
60
|
@updated_at = T.let(DateTime.parse(record["updated_at"]), DateTime)
|
|
56
|
-
@urls = T.let(T.must(record["urls"]).split("\n"), T::Array[String])
|
|
57
61
|
end
|
|
58
62
|
|
|
59
63
|
sig { params(_args: T.untyped).returns(String) }
|
|
60
64
|
def to_json(*_args)
|
|
61
65
|
{
|
|
66
|
+
active_urls: @active_urls,
|
|
62
67
|
created_at: @created_at,
|
|
63
68
|
creator_id: @creator_id,
|
|
64
69
|
group_name: @group_name,
|
|
65
70
|
id: @id,
|
|
71
|
+
inactive_urls: @inactive_urls,
|
|
66
72
|
is_active: @is_active,
|
|
67
73
|
is_locked: @is_locked,
|
|
68
74
|
linked_user_id: @linked_user_id,
|
|
69
75
|
name: @name,
|
|
70
76
|
other_names: @other_names,
|
|
71
77
|
updated_at: @updated_at,
|
|
72
|
-
urls: @urls,
|
|
73
78
|
}.to_json
|
|
74
79
|
end
|
|
75
80
|
end
|
|
@@ -12,12 +12,18 @@ module E621ExportDownloader
|
|
|
12
12
|
sig { returns(DateTime) }
|
|
13
13
|
attr_reader(:created_at)
|
|
14
14
|
|
|
15
|
+
sig { returns(Integer) }
|
|
16
|
+
attr_reader(:down_votes)
|
|
17
|
+
|
|
15
18
|
sig { returns(T.nilable(Integer)) }
|
|
16
19
|
attr_reader(:forum_topic_id)
|
|
17
20
|
|
|
18
21
|
sig { returns(Integer) }
|
|
19
22
|
attr_reader(:id)
|
|
20
23
|
|
|
24
|
+
sig { returns(Integer) }
|
|
25
|
+
attr_reader(:meh_votes)
|
|
26
|
+
|
|
21
27
|
sig { returns(String) }
|
|
22
28
|
attr_reader(:script)
|
|
23
29
|
|
|
@@ -27,6 +33,9 @@ module E621ExportDownloader
|
|
|
27
33
|
sig { returns(T.nilable(String)) }
|
|
28
34
|
attr_reader(:title)
|
|
29
35
|
|
|
36
|
+
sig { returns(Integer) }
|
|
37
|
+
attr_reader(:up_votes)
|
|
38
|
+
|
|
30
39
|
sig { returns(DateTime) }
|
|
31
40
|
attr_reader(:updated_at)
|
|
32
41
|
|
|
@@ -38,11 +47,14 @@ module E621ExportDownloader
|
|
|
38
47
|
@record = T.let(record, T::Hash[String, String])
|
|
39
48
|
@approver_id = T.let(T.must(record["approver_id"]).empty? ? nil : record["approver_id"].to_i, T.nilable(Integer))
|
|
40
49
|
@created_at = T.let(DateTime.parse(record["created_at"]), DateTime)
|
|
50
|
+
@down_votes = T.let(record["down_votes"].to_i, Integer)
|
|
41
51
|
@forum_topic_id = T.let(T.must(record["forum_topic_id"]).empty? ? nil : record["forum_topic_id"].to_i, T.nilable(Integer))
|
|
42
52
|
@id = T.let(record["id"].to_i, Integer)
|
|
53
|
+
@meh_votes = T.let(record["meh_votes"].to_i, Integer)
|
|
43
54
|
@script = T.let(T.must(record["script"]), String)
|
|
44
55
|
@status = T.let(T.must(record["status"]), String)
|
|
45
56
|
@title = T.let(T.must(record["title"]).empty? ? nil : record["title"], T.nilable(String))
|
|
57
|
+
@up_votes = T.let(record["up_votes"].to_i, Integer)
|
|
46
58
|
@updated_at = T.let(DateTime.parse(record["updated_at"]), DateTime)
|
|
47
59
|
@user_id = T.let(record["user_id"].to_i, Integer)
|
|
48
60
|
end
|
|
@@ -52,11 +64,14 @@ module E621ExportDownloader
|
|
|
52
64
|
{
|
|
53
65
|
approver_id: @approver_id,
|
|
54
66
|
created_at: @created_at,
|
|
67
|
+
down_votes: @down_votes,
|
|
55
68
|
forum_topic_id: @forum_topic_id,
|
|
56
69
|
id: @id,
|
|
70
|
+
meh_votes: @meh_votes,
|
|
57
71
|
script: @script,
|
|
58
72
|
status: @status,
|
|
59
73
|
title: @title,
|
|
74
|
+
up_votes: @up_votes,
|
|
60
75
|
updated_at: @updated_at,
|
|
61
76
|
user_id: @user_id,
|
|
62
77
|
}.to_json
|
|
@@ -9,6 +9,9 @@ module E621ExportDownloader
|
|
|
9
9
|
sig { returns(T.nilable(Integer)) }
|
|
10
10
|
attr_reader(:approver_id)
|
|
11
11
|
|
|
12
|
+
sig { returns(T.nilable(String)) }
|
|
13
|
+
attr_reader(:bg_color)
|
|
14
|
+
|
|
12
15
|
sig { returns(Integer) }
|
|
13
16
|
attr_reader(:change_seq)
|
|
14
17
|
|
|
@@ -63,6 +66,12 @@ module E621ExportDownloader
|
|
|
63
66
|
sig { returns(T::Boolean) }
|
|
64
67
|
attr_reader(:is_status_locked)
|
|
65
68
|
|
|
69
|
+
sig { returns(T.nilable(DateTime)) }
|
|
70
|
+
attr_reader(:last_commented_at)
|
|
71
|
+
|
|
72
|
+
sig { returns(T.nilable(DateTime)) }
|
|
73
|
+
attr_reader(:last_noted_at)
|
|
74
|
+
|
|
66
75
|
sig { returns(String) }
|
|
67
76
|
attr_reader(:locked_tags)
|
|
68
77
|
|
|
@@ -96,69 +105,75 @@ module E621ExportDownloader
|
|
|
96
105
|
sig { params(record: T::Hash[String, String]).void }
|
|
97
106
|
def initialize(record)
|
|
98
107
|
@record = T.let(record, T::Hash[String, String])
|
|
99
|
-
@approver_id
|
|
100
|
-
@
|
|
101
|
-
@
|
|
102
|
-
@
|
|
103
|
-
@
|
|
104
|
-
@
|
|
105
|
-
@
|
|
106
|
-
@
|
|
107
|
-
@
|
|
108
|
-
@
|
|
109
|
-
@
|
|
110
|
-
@
|
|
111
|
-
@
|
|
112
|
-
@
|
|
113
|
-
@
|
|
114
|
-
@
|
|
115
|
-
@
|
|
116
|
-
@
|
|
117
|
-
@
|
|
118
|
-
@
|
|
119
|
-
@
|
|
120
|
-
@
|
|
121
|
-
@
|
|
122
|
-
@
|
|
123
|
-
@
|
|
124
|
-
@
|
|
125
|
-
@
|
|
126
|
-
@
|
|
127
|
-
@
|
|
108
|
+
@approver_id = T.let(T.must(record["approver_id"]).empty? ? nil : record["approver_id"].to_i, T.nilable(Integer))
|
|
109
|
+
@bg_color = T.let(T.must(record["bg_color"]).empty? ? nil : record["bg_color"], T.nilable(String))
|
|
110
|
+
@change_seq = T.let(record["change_seq"].to_i, Integer)
|
|
111
|
+
@comment_count = T.let(record["comment_count"].to_i, Integer)
|
|
112
|
+
@created_at = T.let(DateTime.parse(record["created_at"]), DateTime)
|
|
113
|
+
@description = T.let(T.must(record["description"]).gsub("\r\n", "\n"), String)
|
|
114
|
+
@down_score = T.let(record["down_score"].to_i, Integer)
|
|
115
|
+
@duration = T.let(T.must(record["duration"]).empty? ? nil : record["duration"].to_f, T.nilable(Float))
|
|
116
|
+
@fav_count = T.let(record["fav_count"].to_i, Integer)
|
|
117
|
+
@file_ext = T.let(T.must(record["file_ext"]), String)
|
|
118
|
+
@file_size = T.let(record["file_size"].to_i, Integer)
|
|
119
|
+
@id = T.let(record["id"].to_i, Integer)
|
|
120
|
+
@image_height = T.let(record["image_height"].to_i, Integer)
|
|
121
|
+
@image_width = T.let(record["image_width"].to_i, Integer)
|
|
122
|
+
@is_deleted = T.let(record["is_deleted"] == "t", T::Boolean)
|
|
123
|
+
@is_flagged = T.let(record["is_flagged"] == "t", T::Boolean)
|
|
124
|
+
@is_note_locked = T.let(record["is_note_locked"] == "t", T::Boolean)
|
|
125
|
+
@is_pending = T.let(record["is_pending"] == "t", T::Boolean)
|
|
126
|
+
@is_rating_locked = T.let(record["is_rating_locked"] == "t", T::Boolean)
|
|
127
|
+
@is_status_locked = T.let(record["is_status_locked"] == "t", T::Boolean)
|
|
128
|
+
@last_commented_at = T.let(T.must(record["last_commented_at"]).empty? ? nil : DateTime.parse(record["last_commented_at"]), T.nilable(DateTime))
|
|
129
|
+
@last_noted_at = T.let(T.must(record["last_noted_at"]).empty? ? nil : DateTime.parse(record["last_noted_at"]), T.nilable(DateTime))
|
|
130
|
+
@locked_tags = T.let(T.must(record["locked_tags"]), String)
|
|
131
|
+
@md5 = T.let(T.must(record["md5"]).empty? ? nil : record["md5"], T.nilable(String))
|
|
132
|
+
@parent_id = T.let(T.must(record["parent_id"]).empty? ? nil : record["parent_id"].to_i, T.nilable(Integer))
|
|
133
|
+
@rating = T.let(T.must(record["rating"]), String)
|
|
134
|
+
@score = T.let(record["score"].to_i, Integer)
|
|
135
|
+
@sources = T.let(T.must(record["source"]).gsub("\r\n", "\n").split("\n"), T::Array[String])
|
|
136
|
+
@tags = T.let(T.must(record["tag_string"]).split, T::Array[String])
|
|
137
|
+
@up_score = T.let(record["up_score"].to_i, Integer)
|
|
138
|
+
@updated_at = T.let(T.must(record["updated_at"]).empty? ? nil : DateTime.parse(record["updated_at"]), T.nilable(DateTime))
|
|
139
|
+
@uploader_id = T.let(T.must(record["uploader_id"]).empty? ? nil : record["uploader_id"].to_i, T.nilable(Integer))
|
|
128
140
|
end
|
|
129
141
|
|
|
130
142
|
sig { params(_args: T.untyped).returns(String) }
|
|
131
143
|
def to_json(*_args)
|
|
132
144
|
{
|
|
133
|
-
approver_id:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
145
|
+
approver_id: @approver_id,
|
|
146
|
+
bg_color: @bg_color,
|
|
147
|
+
change_seq: @change_seq,
|
|
148
|
+
comment_count: @comment_count,
|
|
149
|
+
created_at: @created_at,
|
|
150
|
+
description: @description,
|
|
151
|
+
down_score: @down_score,
|
|
152
|
+
duration: @duration,
|
|
153
|
+
fav_count: @fav_count,
|
|
154
|
+
file_ext: @file_ext,
|
|
155
|
+
file_size: @file_size,
|
|
156
|
+
id: @id,
|
|
157
|
+
image_height: @image_height,
|
|
158
|
+
image_width: @image_width,
|
|
159
|
+
is_deleted: @is_deleted,
|
|
160
|
+
is_flagged: @is_flagged,
|
|
161
|
+
is_note_locked: @is_note_locked,
|
|
162
|
+
is_pending: @is_pending,
|
|
163
|
+
is_rating_locked: @is_rating_locked,
|
|
164
|
+
is_status_locked: @is_status_locked,
|
|
165
|
+
last_commented_at: @last_commented_at,
|
|
166
|
+
last_noted_at: @last_noted_at,
|
|
167
|
+
locked_tags: @locked_tags,
|
|
168
|
+
md5: @md5,
|
|
169
|
+
parent_id: @parent_id,
|
|
170
|
+
rating: @rating,
|
|
171
|
+
score: @score,
|
|
172
|
+
sources: @sources,
|
|
173
|
+
tags: @tags,
|
|
174
|
+
up_score: @up_score,
|
|
175
|
+
updated_at: @updated_at,
|
|
176
|
+
uploader_id: @uploader_id,
|
|
162
177
|
}.to_json
|
|
163
178
|
end
|
|
164
179
|
end
|
|
@@ -9,36 +9,86 @@ module E621ExportDownloader
|
|
|
9
9
|
sig { returns(String) }
|
|
10
10
|
attr_reader(:antecedent_name)
|
|
11
11
|
|
|
12
|
+
sig { returns(T.nilable(Integer)) }
|
|
13
|
+
attr_reader(:approver_id)
|
|
14
|
+
|
|
12
15
|
sig { returns(String) }
|
|
13
16
|
attr_reader(:consequent_name)
|
|
14
17
|
|
|
15
18
|
sig { returns(T.nilable(DateTime)) }
|
|
16
19
|
attr_reader(:created_at)
|
|
17
20
|
|
|
21
|
+
# sig { returns(T.nilable(Integer)) }
|
|
22
|
+
# attr_reader(:creator_id)
|
|
23
|
+
|
|
24
|
+
sig { returns(Integer) }
|
|
25
|
+
attr_reader(:down_votes)
|
|
26
|
+
|
|
27
|
+
sig { returns(T.nilable(Integer)) }
|
|
28
|
+
attr_reader(:forum_post_id)
|
|
29
|
+
|
|
30
|
+
sig { returns(T.nilable(Integer)) }
|
|
31
|
+
attr_reader(:forum_topic_id)
|
|
32
|
+
|
|
18
33
|
sig { returns(Integer) }
|
|
19
34
|
attr_reader(:id)
|
|
20
35
|
|
|
36
|
+
sig { returns(Integer) }
|
|
37
|
+
attr_reader(:meh_votes)
|
|
38
|
+
|
|
39
|
+
sig { returns(Integer) }
|
|
40
|
+
attr_reader(:post_count)
|
|
41
|
+
|
|
42
|
+
sig { returns(String) }
|
|
43
|
+
attr_reader(:reason)
|
|
44
|
+
|
|
21
45
|
sig { returns(String) }
|
|
22
46
|
attr_reader(:status)
|
|
23
47
|
|
|
48
|
+
sig { returns(Integer) }
|
|
49
|
+
attr_reader(:up_votes)
|
|
50
|
+
|
|
51
|
+
sig { returns(T.nilable(DateTime)) }
|
|
52
|
+
attr_reader(:updated_at)
|
|
53
|
+
|
|
24
54
|
sig { params(record: T::Hash[String, String]).void }
|
|
25
55
|
def initialize(record)
|
|
26
|
-
@record
|
|
56
|
+
@record = T.let(record, T::Hash[String, String])
|
|
27
57
|
@antecedent_name = T.let(T.must(record["antecedent_name"]), String)
|
|
58
|
+
@approver_id = T.let(T.must(record["approver_id"]).empty? ? nil : record["approver_id"].to_i, T.nilable(Integer))
|
|
28
59
|
@consequent_name = T.let(T.must(record["consequent_name"]), String)
|
|
29
|
-
@created_at
|
|
30
|
-
@
|
|
31
|
-
@
|
|
60
|
+
@created_at = T.let(T.must(record["created_at"]).empty? ? nil : DateTime.parse(record["created_at"]), T.nilable(DateTime))
|
|
61
|
+
# @creator_id = T.let(T.must(record["creator_id"]).empty? ? nil : record["creator_id"].to_i, T.nilable(Integer))
|
|
62
|
+
@down_votes = T.let(record["down_votes"].to_i, Integer)
|
|
63
|
+
@forum_post_id = T.let(T.must(record["forum_post_id"]).empty? ? nil : record["forum_post_id"].to_i, T.nilable(Integer))
|
|
64
|
+
@forum_topic_id = T.let(T.must(record["forum_topic_id"]).empty? ? nil : record["forum_topic_id"].to_i, T.nilable(Integer))
|
|
65
|
+
@id = T.let(record["id"].to_i, Integer)
|
|
66
|
+
@meh_votes = T.let(record["meh_votes"].to_i, Integer)
|
|
67
|
+
@post_count = T.let(record["post_count"].to_i, Integer)
|
|
68
|
+
@reason = T.let(T.must(record["reason"]), String)
|
|
69
|
+
@status = T.let(T.must(record["status"]), String)
|
|
70
|
+
@up_votes = T.let(record["up_votes"].to_i, Integer)
|
|
71
|
+
@updated_at = T.let(T.must(record["updated_at"]).empty? ? nil : DateTime.parse(record["updated_at"]), T.nilable(DateTime))
|
|
32
72
|
end
|
|
33
73
|
|
|
34
74
|
sig { params(_args: T.untyped).returns(String) }
|
|
35
75
|
def to_json(*_args)
|
|
36
76
|
{
|
|
37
77
|
antecedent_name: @antecedent_name,
|
|
78
|
+
approver_id: @approver_id,
|
|
38
79
|
consequent_name: @consequent_name,
|
|
39
80
|
created_at: @created_at,
|
|
81
|
+
# creator_id: @creator_id,
|
|
82
|
+
down_votes: @down_votes,
|
|
83
|
+
forum_post_id: @forum_post_id,
|
|
84
|
+
forum_topic_id: @forum_topic_id,
|
|
40
85
|
id: @id,
|
|
86
|
+
meh_votes: @meh_votes,
|
|
87
|
+
post_count: @post_count,
|
|
88
|
+
reason: @reason,
|
|
41
89
|
status: @status,
|
|
90
|
+
up_votes: @up_votes,
|
|
91
|
+
updated_at: @updated_at,
|
|
42
92
|
}.to_json
|
|
43
93
|
end
|
|
44
94
|
end
|
|
@@ -9,36 +9,87 @@ module E621ExportDownloader
|
|
|
9
9
|
sig { returns(String) }
|
|
10
10
|
attr_reader(:antecedent_name)
|
|
11
11
|
|
|
12
|
+
sig { returns(T.nilable(Integer)) }
|
|
13
|
+
attr_reader(:approver_id)
|
|
14
|
+
|
|
12
15
|
sig { returns(String) }
|
|
13
16
|
attr_reader(:consequent_name)
|
|
14
17
|
|
|
15
18
|
sig { returns(T.nilable(DateTime)) }
|
|
16
19
|
attr_reader(:created_at)
|
|
17
20
|
|
|
21
|
+
# sig { returns(T.nilable(Integer)) }
|
|
22
|
+
# attr_reader(:creator_id)
|
|
23
|
+
|
|
24
|
+
sig { returns(T::Array[String]) }
|
|
25
|
+
attr_reader(:descendant_names)
|
|
26
|
+
|
|
27
|
+
sig { returns(Integer) }
|
|
28
|
+
attr_reader(:down_votes)
|
|
29
|
+
|
|
30
|
+
sig { returns(T.nilable(Integer)) }
|
|
31
|
+
attr_reader(:forum_post_id)
|
|
32
|
+
|
|
33
|
+
sig { returns(T.nilable(Integer)) }
|
|
34
|
+
attr_reader(:forum_topic_id)
|
|
35
|
+
|
|
18
36
|
sig { returns(Integer) }
|
|
19
37
|
attr_reader(:id)
|
|
20
38
|
|
|
39
|
+
sig { returns(Integer) }
|
|
40
|
+
attr_reader(:meh_votes)
|
|
41
|
+
|
|
42
|
+
sig { returns(String) }
|
|
43
|
+
attr_reader(:reason)
|
|
44
|
+
|
|
21
45
|
sig { returns(String) }
|
|
22
46
|
attr_reader(:status)
|
|
23
47
|
|
|
48
|
+
sig { returns(Integer) }
|
|
49
|
+
attr_reader(:up_votes)
|
|
50
|
+
|
|
51
|
+
sig { returns(T.nilable(DateTime)) }
|
|
52
|
+
attr_reader(:updated_at)
|
|
53
|
+
|
|
24
54
|
sig { params(record: T::Hash[String, String]).void }
|
|
25
55
|
def initialize(record)
|
|
26
|
-
@record
|
|
56
|
+
@record = T.let(record, T::Hash[String, String])
|
|
27
57
|
@antecedent_name = T.let(T.must(record["antecedent_name"]), String)
|
|
58
|
+
@approver_id = T.let(T.must(record["approver_id"]).empty? ? nil : record["approver_id"].to_i, T.nilable(Integer))
|
|
28
59
|
@consequent_name = T.let(T.must(record["consequent_name"]), String)
|
|
29
|
-
@created_at
|
|
30
|
-
@
|
|
31
|
-
|
|
60
|
+
@created_at = T.let(T.must(record["created_at"]).empty? ? nil : DateTime.parse(record["created_at"]), T.nilable(DateTime))
|
|
61
|
+
# @creator_id = T.let(T.must(record["creator_id"]).empty? ? nil : record["creator_id"].to_i, T.nilable(Integer))
|
|
62
|
+
inner = T.must(T.must(record["descendant_names"])[1..-2])
|
|
63
|
+
@descendant_names = T.let(inner.empty? ? [] : inner.split(","), T::Array[String])
|
|
64
|
+
@down_votes = T.let(record["down_votes"].to_i, Integer)
|
|
65
|
+
@forum_post_id = T.let(T.must(record["forum_post_id"]).empty? ? nil : record["forum_post_id"].to_i, T.nilable(Integer))
|
|
66
|
+
@forum_topic_id = T.let(T.must(record["forum_topic_id"]).empty? ? nil : record["forum_topic_id"].to_i, T.nilable(Integer))
|
|
67
|
+
@id = T.let(record["id"].to_i, Integer)
|
|
68
|
+
@meh_votes = T.let(record["meh_votes"].to_i, Integer)
|
|
69
|
+
@reason = T.let(T.must(record["reason"]), String)
|
|
70
|
+
@status = T.let(T.must(record["status"]), String)
|
|
71
|
+
@up_votes = T.let(record["up_votes"].to_i, Integer)
|
|
72
|
+
@updated_at = T.let(T.must(record["updated_at"]).empty? ? nil : DateTime.parse(record["updated_at"]), T.nilable(DateTime))
|
|
32
73
|
end
|
|
33
74
|
|
|
34
75
|
sig { params(_args: T.untyped).returns(String) }
|
|
35
76
|
def to_json(*_args)
|
|
36
77
|
{
|
|
37
|
-
antecedent_name:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
78
|
+
antecedent_name: @antecedent_name,
|
|
79
|
+
approver_id: @approver_id,
|
|
80
|
+
consequent_name: @consequent_name,
|
|
81
|
+
created_at: @created_at,
|
|
82
|
+
# creator_id: @creator_id,
|
|
83
|
+
descendant_names: @descendant_names,
|
|
84
|
+
down_votes: @down_votes,
|
|
85
|
+
forum_post_id: @forum_post_id,
|
|
86
|
+
forum_topic_id: @forum_topic_id,
|
|
87
|
+
id: @id,
|
|
88
|
+
meh_votes: @meh_votes,
|
|
89
|
+
reason: @reason,
|
|
90
|
+
status: @status,
|
|
91
|
+
up_votes: @up_votes,
|
|
92
|
+
updated_at: @updated_at,
|
|
42
93
|
}.to_json
|
|
43
94
|
end
|
|
44
95
|
end
|
|
@@ -21,6 +21,9 @@ module E621ExportDownloader
|
|
|
21
21
|
sig { returns(T::Boolean) }
|
|
22
22
|
attr_reader(:is_locked)
|
|
23
23
|
|
|
24
|
+
sig { returns(T.nilable(String)) }
|
|
25
|
+
attr_reader(:parent)
|
|
26
|
+
|
|
24
27
|
sig { returns(String) }
|
|
25
28
|
attr_reader(:title)
|
|
26
29
|
|
|
@@ -38,7 +41,8 @@ module E621ExportDownloader
|
|
|
38
41
|
@creator_id = T.let(T.must(record["creator_id"]).empty? ? nil : record["creator_id"].to_i, T.nilable(Integer))
|
|
39
42
|
@id = T.let(record["id"].to_i, Integer)
|
|
40
43
|
@is_locked = T.let(record["is_locked"] == "t", T::Boolean)
|
|
41
|
-
@
|
|
44
|
+
@parent = T.let(T.must(record["parent"]).empty? ? nil : record["parent"], T.nilable(String))
|
|
45
|
+
@title = T.let(T.must(record["title"]), String)
|
|
42
46
|
@updated_at = T.let(T.must(record["updated_at"]).empty? ? nil : DateTime.parse(record["updated_at"]), T.nilable(DateTime))
|
|
43
47
|
@updater_id = T.let(T.must(record["updater_id"]).empty? ? nil : record["updater_id"].to_i, T.nilable(Integer))
|
|
44
48
|
end
|
|
@@ -51,6 +55,7 @@ module E621ExportDownloader
|
|
|
51
55
|
creator_id: @creator_id,
|
|
52
56
|
id: @id,
|
|
53
57
|
is_locked: @is_locked,
|
|
58
|
+
parent: @parent,
|
|
54
59
|
title: @title,
|
|
55
60
|
updated_at: @updated_at,
|
|
56
61
|
updater_id: @updater_id,
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
class CreateE621Tables < ActiveRecord::Migration<%= migration_version %>
|
|
4
4
|
def change
|
|
5
|
-
enable_extension("pg_trgm")
|
|
6
|
-
|
|
7
5
|
<% if use_schema? -%>
|
|
8
6
|
reversible do |r|
|
|
9
7
|
r.up { execute("CREATE SCHEMA <%= schema %>") }
|
|
@@ -13,48 +11,46 @@ class CreateE621Tables < ActiveRecord::Migration<%= migration_version %>
|
|
|
13
11
|
<% end -%>
|
|
14
12
|
create_table(<%= table_ref("artists") %>, id: :bigint, default: nil, force: :cascade) do |t|
|
|
15
13
|
t.datetime(:created_at, null: false)
|
|
16
|
-
t.bigint(:creator_id, null: false
|
|
14
|
+
t.bigint(:creator_id, null: false)
|
|
17
15
|
t.string(:group_name)
|
|
18
16
|
t.boolean(:is_active, null: false)
|
|
19
17
|
t.boolean(:is_locked, null: false)
|
|
20
|
-
t.bigint(:linked_user_id
|
|
21
|
-
t.string(:name, null: false
|
|
18
|
+
t.bigint(:linked_user_id)
|
|
19
|
+
t.string(:name, null: false)
|
|
22
20
|
t.text(:other_names, array: true, null: false, default: [])
|
|
23
21
|
t.datetime(:updated_at, null: false)
|
|
24
|
-
t.text(:
|
|
25
|
-
t.
|
|
26
|
-
t.index("name gin_trgm_ops", using: :gin)
|
|
22
|
+
t.text(:active_urls, null: false)
|
|
23
|
+
t.text(:inactive_urls, null: false)
|
|
27
24
|
end
|
|
28
25
|
|
|
29
26
|
create_table(<%= table_ref("bulk_update_requests") %>, id: :bigint, default: nil, force: :cascade) do |t|
|
|
30
|
-
t.bigint(:approver_id
|
|
27
|
+
t.bigint(:approver_id)
|
|
31
28
|
t.datetime(:created_at, null: false)
|
|
32
|
-
t.bigint(:forum_topic_id
|
|
33
|
-
t.bigint(:forum_post_id
|
|
29
|
+
t.bigint(:forum_topic_id)
|
|
30
|
+
t.bigint(:forum_post_id)
|
|
34
31
|
t.text(:script, null: false)
|
|
35
|
-
t.string(:status, null: false
|
|
32
|
+
t.string(:status, null: false)
|
|
36
33
|
t.string(:title)
|
|
37
34
|
t.datetime(:updated_at, null: false)
|
|
38
|
-
t.bigint(:user_id, null: false
|
|
39
|
-
t.
|
|
40
|
-
t.
|
|
35
|
+
t.bigint(:user_id, null: false)
|
|
36
|
+
t.integer(:down_votes, null: false)
|
|
37
|
+
t.integer(:meh_votes, null: false)
|
|
38
|
+
t.integer(:up_votes, null: false)
|
|
41
39
|
end
|
|
42
40
|
|
|
43
41
|
create_table(<%= table_ref("pools") %>, id: :bigint, default: nil, force: :cascade) do |t|
|
|
44
42
|
t.string(:category, null: false)
|
|
45
43
|
t.datetime(:created_at, null: false)
|
|
46
|
-
t.bigint(:creator_id, null: false
|
|
44
|
+
t.bigint(:creator_id, null: false)
|
|
47
45
|
t.text(:description, null: false)
|
|
48
46
|
t.boolean(:is_active, null: false)
|
|
49
|
-
t.string(:name, null: false
|
|
50
|
-
t.bigint(:post_ids, array: true, null: false
|
|
47
|
+
t.string(:name, null: false)
|
|
48
|
+
t.bigint(:post_ids, array: true, null: false)
|
|
51
49
|
t.datetime(:updated_at)
|
|
52
|
-
t.index("description gin_trgm_ops", using: :gin)
|
|
53
|
-
t.index("name gin_trgm_ops", using: :gin)
|
|
54
50
|
end
|
|
55
51
|
|
|
56
52
|
create_table(<%= table_ref("posts") %>, id: :bigint, default: nil, force: :cascade) do |t|
|
|
57
|
-
t.bigint(:approver_id
|
|
53
|
+
t.bigint(:approver_id)
|
|
58
54
|
t.bigint(:change_seq, null: false)
|
|
59
55
|
t.integer(:comment_count, null: false)
|
|
60
56
|
t.datetime(:created_at, null: false)
|
|
@@ -66,112 +62,116 @@ class CreateE621Tables < ActiveRecord::Migration<%= migration_version %>
|
|
|
66
62
|
t.bigint(:file_size, null: false)
|
|
67
63
|
t.integer(:image_height, null: false)
|
|
68
64
|
t.integer(:image_width, null: false)
|
|
69
|
-
t.boolean(:is_deleted, null: false
|
|
70
|
-
t.boolean(:is_flagged, null: false
|
|
71
|
-
t.boolean(:is_note_locked, null: false
|
|
72
|
-
t.boolean(:is_pending, null: false
|
|
73
|
-
t.boolean(:is_rating_locked, null: false
|
|
74
|
-
t.boolean(:is_status_locked, null: false
|
|
65
|
+
t.boolean(:is_deleted, null: false)
|
|
66
|
+
t.boolean(:is_flagged, null: false)
|
|
67
|
+
t.boolean(:is_note_locked, null: false)
|
|
68
|
+
t.boolean(:is_pending, null: false)
|
|
69
|
+
t.boolean(:is_rating_locked, null: false)
|
|
70
|
+
t.boolean(:is_status_locked, null: false)
|
|
75
71
|
t.text(:locked_tags, null: false)
|
|
76
|
-
t.string(:md5,
|
|
77
|
-
t.bigint(:parent_id
|
|
78
|
-
t.string(:rating, null: false
|
|
72
|
+
t.string(:md5, null: false)
|
|
73
|
+
t.bigint(:parent_id)
|
|
74
|
+
t.string(:rating, null: false)
|
|
79
75
|
t.integer(:score, null: false)
|
|
80
76
|
t.text(:source, null: false)
|
|
81
77
|
t.text(:tag_string, null: false)
|
|
82
78
|
t.integer(:up_score, null: false)
|
|
83
|
-
t.datetime(:updated_at
|
|
84
|
-
t.bigint(:uploader_id
|
|
85
|
-
t.
|
|
86
|
-
t.
|
|
87
|
-
t.
|
|
79
|
+
t.datetime(:updated_at)
|
|
80
|
+
t.bigint(:uploader_id)
|
|
81
|
+
t.string(:bg_color)
|
|
82
|
+
t.datetime(:last_noted_at)
|
|
83
|
+
t.datetime(:last_commented_at)
|
|
88
84
|
end
|
|
89
85
|
|
|
90
86
|
create_table(<%= table_ref("post_replacements") %>, id: :bigint, default: nil, force: :cascade) do |t|
|
|
91
|
-
t.bigint(:approver_id
|
|
87
|
+
t.bigint(:approver_id)
|
|
92
88
|
t.datetime(:created_at, null: false)
|
|
93
|
-
t.bigint(:creator_id, null: false
|
|
94
|
-
t.string(:file_ext, null: false
|
|
95
|
-
t.string(:file_name, null: false
|
|
96
|
-
t.bigint(:file_size, null: false
|
|
97
|
-
t.integer(:image_height, null: false
|
|
98
|
-
t.integer(:image_width, null: false
|
|
99
|
-
t.string(:md5, null: false
|
|
100
|
-
t.bigint(:post_id, null: false
|
|
89
|
+
t.bigint(:creator_id, null: false)
|
|
90
|
+
t.string(:file_ext, null: false)
|
|
91
|
+
t.string(:file_name, null: false)
|
|
92
|
+
t.bigint(:file_size, null: false)
|
|
93
|
+
t.integer(:image_height, null: false)
|
|
94
|
+
t.integer(:image_width, null: false)
|
|
95
|
+
t.string(:md5, null: false)
|
|
96
|
+
t.bigint(:post_id, null: false)
|
|
101
97
|
t.text(:reason, null: false)
|
|
102
98
|
t.text(:source)
|
|
103
|
-
t.string(:status, null: false
|
|
99
|
+
t.string(:status, null: false)
|
|
104
100
|
t.datetime(:updated_at, null: false)
|
|
105
|
-
t.index("reason gin_trgm_ops", using: :gin)
|
|
106
|
-
t.index("source gin_trgm_ops", using: :gin)
|
|
107
101
|
end
|
|
108
102
|
|
|
109
103
|
create_table(<%= table_ref("post_versions") %>, id: :bigint, default: nil, force: :cascade) do |t|
|
|
110
104
|
t.text(:added_locked_tags, array: true, null: false, default: [])
|
|
111
105
|
t.text(:added_tags, array: true, null: false, default: [])
|
|
112
106
|
t.text(:description)
|
|
113
|
-
t.boolean(:description_changed, null: false
|
|
107
|
+
t.boolean(:description_changed, null: false)
|
|
114
108
|
t.text(:locked_tags)
|
|
115
|
-
t.boolean(:parent_changed, null: false
|
|
109
|
+
t.boolean(:parent_changed, null: false)
|
|
116
110
|
t.bigint(:parent_id)
|
|
117
|
-
t.bigint(:post_id, null: false
|
|
111
|
+
t.bigint(:post_id, null: false)
|
|
118
112
|
t.string(:rating)
|
|
119
|
-
t.boolean(:rating_changed, null: false
|
|
113
|
+
t.boolean(:rating_changed, null: false)
|
|
120
114
|
t.text(:reason)
|
|
121
115
|
t.text(:removed_locked_tags, array: true, null: false, default: [])
|
|
122
116
|
t.text(:removed_tags, array: true, null: false, default: [])
|
|
123
117
|
t.text(:source)
|
|
124
|
-
t.boolean(:source_changed, null: false
|
|
118
|
+
t.boolean(:source_changed, null: false)
|
|
125
119
|
t.text(:tags)
|
|
126
|
-
t.datetime(:updated_at, null: false
|
|
127
|
-
t.bigint(:updater_id
|
|
128
|
-
t.integer(:version, null: false
|
|
129
|
-
t.index("description gin_trgm_ops", using: :gin)
|
|
130
|
-
t.index("locked_tags gin_trgm_ops", using: :gin)
|
|
131
|
-
t.index("reason gin_trgm_ops", using: :gin)
|
|
132
|
-
t.index("source gin_trgm_ops", using: :gin)
|
|
133
|
-
t.index("tags gin_trgm_ops", using: :gin)
|
|
120
|
+
t.datetime(:updated_at, null: false)
|
|
121
|
+
t.bigint(:updater_id)
|
|
122
|
+
t.integer(:version, null: false)
|
|
134
123
|
end
|
|
135
124
|
|
|
136
125
|
create_table(<%= table_ref("tag_aliases") %>, id: :bigint, default: nil, force: :cascade) do |t|
|
|
137
|
-
t.string(:antecedent_name, null: false
|
|
138
|
-
t.string(:consequent_name, null: false
|
|
126
|
+
t.string(:antecedent_name, null: false)
|
|
127
|
+
t.string(:consequent_name, null: false)
|
|
139
128
|
t.datetime(:created_at)
|
|
140
|
-
t.string(:status, null: false
|
|
141
|
-
t.
|
|
142
|
-
t.
|
|
143
|
-
t.
|
|
129
|
+
t.string(:status, null: false)
|
|
130
|
+
t.integer(:forum_post_id, null: false)
|
|
131
|
+
t.integer(:forum_topic_id, null: false)
|
|
132
|
+
t.string(:reason, null: false)
|
|
133
|
+
t.datetime(:updated_at)
|
|
134
|
+
t.integer(:approver_id)
|
|
135
|
+
t.integer(:post_count, null: false)
|
|
136
|
+
t.integer(:down_votes, null: false)
|
|
137
|
+
t.integer(:meh_votes, null: false)
|
|
138
|
+
t.integer(:up_votes, null: false)
|
|
144
139
|
end
|
|
145
140
|
|
|
146
141
|
create_table(<%= table_ref("tag_implications") %>, id: :bigint, default: nil, force: :cascade) do |t|
|
|
147
|
-
t.string(:antecedent_name, null: false
|
|
148
|
-
t.string(:consequent_name, null: false
|
|
142
|
+
t.string(:antecedent_name, null: false)
|
|
143
|
+
t.string(:consequent_name, null: false)
|
|
149
144
|
t.datetime(:created_at)
|
|
150
|
-
t.string(:status, null: false
|
|
151
|
-
t.
|
|
152
|
-
t.
|
|
153
|
-
t.
|
|
154
|
-
t.
|
|
145
|
+
t.string(:status, null: false)
|
|
146
|
+
t.integer(:forum_post_id, null: false)
|
|
147
|
+
t.integer(:forum_topic_id, null: false)
|
|
148
|
+
t.string(:reason, null: false)
|
|
149
|
+
t.datetime(:updated_at)
|
|
150
|
+
t.integer(:approver_id)
|
|
151
|
+
t.string(:descendant_names, array: true)
|
|
152
|
+
t.integer(:down_votes, null: false)
|
|
153
|
+
t.integer(:meh_votes, null: false)
|
|
154
|
+
t.integer(:up_votes, null: false)
|
|
155
155
|
end
|
|
156
156
|
|
|
157
157
|
create_table(<%= table_ref("tags") %>, id: :bigint, default: nil, force: :cascade) do |t|
|
|
158
|
-
t.string(:category, null: false
|
|
159
|
-
t.string(:name, null: false
|
|
160
|
-
t.integer(:post_count, null: false
|
|
161
|
-
t.
|
|
162
|
-
t.
|
|
158
|
+
t.string(:category, null: false)
|
|
159
|
+
t.string(:name, null: false)
|
|
160
|
+
t.integer(:post_count, null: false)
|
|
161
|
+
t.datetime(:created_at, null: false)
|
|
162
|
+
t.datetime(:updated_at, null: false)
|
|
163
|
+
t.boolean(:is_locked, null: false)
|
|
163
164
|
end
|
|
164
165
|
|
|
165
166
|
create_table(<%= table_ref("wiki_pages") %>, id: :bigint, default: nil, force: :cascade) do |t|
|
|
166
|
-
t.text(:body, null: false
|
|
167
|
+
t.text(:body, null: false)
|
|
167
168
|
t.datetime(:created_at, null: false)
|
|
168
|
-
t.bigint(:creator_id, null: false
|
|
169
|
-
t.boolean(:is_locked, null: false
|
|
170
|
-
t.string(:title, null: false
|
|
169
|
+
t.bigint(:creator_id, null: false)
|
|
170
|
+
t.boolean(:is_locked, null: false)
|
|
171
|
+
t.string(:title, null: false)
|
|
171
172
|
t.datetime(:updated_at, null: false)
|
|
172
|
-
t.bigint(:updater_id
|
|
173
|
-
t.
|
|
174
|
-
t.index("title gin_trgm_ops", using: :gin)
|
|
173
|
+
t.bigint(:updater_id)
|
|
174
|
+
t.string(:parent)
|
|
175
175
|
end
|
|
176
176
|
|
|
177
177
|
create_table(<%= table_ref("row_counts") %>, primary_key: :table_name, id: :string, force: :cascade) do |t|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require("date")
|
|
5
|
+
|
|
6
|
+
def categorize(subject)
|
|
7
|
+
case subject
|
|
8
|
+
when /\Aadd /i then "Added"
|
|
9
|
+
when /\Afix /i then "Fixed"
|
|
10
|
+
when /\Aoptimize /i, /\Arefactor /i, /\Aupdate /i then "Changed"
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
shas = `git log --follow --format="%H" -- lib/e621_export_downloader/version.rb`.strip.split("\n")
|
|
15
|
+
|
|
16
|
+
entries = shas.map do |sha|
|
|
17
|
+
subject = `git log -1 --format="%s" #{sha}`.strip
|
|
18
|
+
date_str = `git log -1 --format="%ai" #{sha}`.strip
|
|
19
|
+
body = `git log -1 --format="%b" #{sha}`.strip
|
|
20
|
+
version_file = `git show #{sha}:lib/e621_export_downloader/version.rb`
|
|
21
|
+
version = version_file.match(/VERSION = "([^"]+)"/)[1]
|
|
22
|
+
date = Date.parse(date_str).strftime("%Y-%m-%d")
|
|
23
|
+
section = categorize(subject)
|
|
24
|
+
|
|
25
|
+
{ version: version, date: date, section: section, subject: subject, body: body }
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
changelog = +"# Changelog\n"
|
|
29
|
+
|
|
30
|
+
entries.each do |e|
|
|
31
|
+
changelog << "\n## [#{e[:version]}] - #{e[:date]}\n"
|
|
32
|
+
|
|
33
|
+
section = e[:section]
|
|
34
|
+
if section
|
|
35
|
+
changelog << "\n### #{section}\n"
|
|
36
|
+
changelog << "- #{e[:subject]}"
|
|
37
|
+
|
|
38
|
+
unless e[:body].empty?
|
|
39
|
+
refs = e[:body].scan(/(?:from|pending):\s*\S+/).join(", ")
|
|
40
|
+
changelog << " (#{refs})" unless refs.empty?
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
changelog << "\n"
|
|
44
|
+
else
|
|
45
|
+
changelog << "\n_#{e[:subject]}_\n"
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
File.write("CHANGELOG.md", changelog)
|
|
50
|
+
puts("Generated CHANGELOG.md")
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: e621_export_downloader
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.17
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Donovan_DMC
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-06-
|
|
10
|
+
date: 2026-06-29 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: csv
|
|
@@ -75,6 +75,7 @@ extra_rdoc_files: []
|
|
|
75
75
|
files:
|
|
76
76
|
- ".irbrc"
|
|
77
77
|
- ".ruby-version"
|
|
78
|
+
- CHANGELOG.md
|
|
78
79
|
- LICENSE
|
|
79
80
|
- README.md
|
|
80
81
|
- Rakefile
|
|
@@ -118,6 +119,7 @@ files:
|
|
|
118
119
|
- lib/generators/e621_export_downloader/install_generator.rb
|
|
119
120
|
- lib/generators/e621_export_downloader/templates/initializers/e621_models.rb.erb
|
|
120
121
|
- lib/generators/e621_export_downloader/templates/migrations/create_e621_tables.rb.erb
|
|
122
|
+
- scripts/generate_changelog.rb
|
|
121
123
|
- sorbet/config
|
|
122
124
|
- sorbet/rbi/annotations/.gitattributes
|
|
123
125
|
- sorbet/rbi/annotations/faraday.rbi
|