e621_export_downloader 0.0.7 → 0.0.8
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/lib/e621/artist.rb +2 -0
- data/lib/e621/bulk_update_request.rb +2 -0
- data/lib/e621/csv_importable.rb +18 -0
- data/lib/e621/pool.rb +2 -0
- data/lib/e621/post.rb +2 -0
- data/lib/e621/post_replacement.rb +2 -0
- data/lib/e621/post_version.rb +2 -0
- data/lib/e621/tag.rb +2 -0
- data/lib/e621/tag_alias.rb +2 -0
- data/lib/e621/tag_implication.rb +2 -0
- data/lib/e621/wiki_page.rb +2 -0
- data/lib/e621_export_downloader/version.rb +1 -1
- data/lib/generators/e621_export_downloader/templates/migrations/create_e621_tables.rb.erb +1 -1
- metadata +2 -2
- data/db/migrate/create_e621_tables.rb +0 -179
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a44fd575ff1086824b28fac6aea0d0bf9e11fa927d8d8a0744d40adf1f3a5447
|
|
4
|
+
data.tar.gz: be0f6c940882caa3c8982016a97fc89b2247ae0d7a812e79f05be149bc5a53f9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 86db94cf55a30d1ec65a9e7be382f4416182cad9e4ac0938a133e2def3425a82bfbc35fb2730ad5fac436758c27e28a55379bcd29ad2562c8d5159f96fa89d69
|
|
7
|
+
data.tar.gz: 24a949b48845e4eff3cc7cb5d2c5747f9f2af6e656b2cb30ba365ac693fe177f81a1b23843e2da26e4567c16133502c3200a723cedd193e96568441c6ad6abd7
|
data/lib/e621/artist.rb
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
# typed: true
|
|
3
3
|
|
|
4
4
|
require("active_record")
|
|
5
|
+
require_relative("csv_importable")
|
|
5
6
|
|
|
6
7
|
module E621
|
|
7
8
|
class BulkUpdateRequest < ActiveRecord::Base
|
|
8
9
|
extend(T::Sig)
|
|
10
|
+
extend(E621::CsvImportable)
|
|
9
11
|
|
|
10
12
|
self.table_name = "e621.bulk_update_requests"
|
|
11
13
|
self.record_timestamps = false
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# typed: true
|
|
3
|
+
|
|
4
|
+
module E621
|
|
5
|
+
module CsvImportable
|
|
6
|
+
extend(T::Sig)
|
|
7
|
+
|
|
8
|
+
sig { params(csv_path: String).returns(T.untyped) }
|
|
9
|
+
def import_from_csv(csv_path)
|
|
10
|
+
raw = T.unsafe(self).connection.raw_connection
|
|
11
|
+
raw.copy_data("COPY #{T.unsafe(self).quoted_table_name} FROM STDIN WITH (FORMAT CSV, HEADER TRUE)") do
|
|
12
|
+
File.open(csv_path, "rb") do |f|
|
|
13
|
+
raw.put_copy_data(f.read(65_536)) until f.eof?
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
data/lib/e621/pool.rb
CHANGED
data/lib/e621/post.rb
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
# typed: true
|
|
3
3
|
|
|
4
4
|
require("active_record")
|
|
5
|
+
require_relative("csv_importable")
|
|
5
6
|
|
|
6
7
|
module E621
|
|
7
8
|
class PostReplacement < ActiveRecord::Base
|
|
8
9
|
extend(T::Sig)
|
|
10
|
+
extend(E621::CsvImportable)
|
|
9
11
|
|
|
10
12
|
self.table_name = "e621.post_replacements"
|
|
11
13
|
self.record_timestamps = false
|
data/lib/e621/post_version.rb
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
# typed: true
|
|
3
3
|
|
|
4
4
|
require("active_record")
|
|
5
|
+
require_relative("csv_importable")
|
|
5
6
|
|
|
6
7
|
module E621
|
|
7
8
|
class PostVersion < ActiveRecord::Base
|
|
8
9
|
extend(T::Sig)
|
|
10
|
+
extend(E621::CsvImportable)
|
|
9
11
|
|
|
10
12
|
self.table_name = "e621.post_versions"
|
|
11
13
|
self.record_timestamps = false
|
data/lib/e621/tag.rb
CHANGED
data/lib/e621/tag_alias.rb
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
# typed: true
|
|
3
3
|
|
|
4
4
|
require("active_record")
|
|
5
|
+
require_relative("csv_importable")
|
|
5
6
|
|
|
6
7
|
module E621
|
|
7
8
|
class TagAlias < ActiveRecord::Base
|
|
8
9
|
extend(T::Sig)
|
|
10
|
+
extend(E621::CsvImportable)
|
|
9
11
|
|
|
10
12
|
self.table_name = "e621.tag_aliases"
|
|
11
13
|
self.record_timestamps = false
|
data/lib/e621/tag_implication.rb
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
# typed: true
|
|
3
3
|
|
|
4
4
|
require("active_record")
|
|
5
|
+
require_relative("csv_importable")
|
|
5
6
|
|
|
6
7
|
module E621
|
|
7
8
|
class TagImplication < ActiveRecord::Base
|
|
8
9
|
extend(T::Sig)
|
|
10
|
+
extend(E621::CsvImportable)
|
|
9
11
|
|
|
10
12
|
self.table_name = "e621.tag_implications"
|
|
11
13
|
self.record_timestamps = false
|
data/lib/e621/wiki_page.rb
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
# typed: true
|
|
3
3
|
|
|
4
4
|
require("active_record")
|
|
5
|
+
require_relative("csv_importable")
|
|
5
6
|
|
|
6
7
|
module E621
|
|
7
8
|
class WikiPage < ActiveRecord::Base
|
|
8
9
|
extend(T::Sig)
|
|
10
|
+
extend(E621::CsvImportable)
|
|
9
11
|
|
|
10
12
|
self.table_name = "e621.wiki_pages"
|
|
11
13
|
self.record_timestamps = false
|
|
@@ -5,7 +5,7 @@ class CreateE621Tables < ActiveRecord::Migration<%= migration_version %>
|
|
|
5
5
|
<% if use_schema? -%>
|
|
6
6
|
reversible do |r|
|
|
7
7
|
r.up { execute("CREATE SCHEMA <%= schema %>") }
|
|
8
|
-
r.down { execute("DROP SCHEMA <%= schema %>
|
|
8
|
+
r.down { execute("DROP SCHEMA <%= schema %>") }
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
<% end -%>
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Donovan_DMC
|
|
@@ -78,10 +78,10 @@ files:
|
|
|
78
78
|
- LICENSE
|
|
79
79
|
- README.md
|
|
80
80
|
- Rakefile
|
|
81
|
-
- db/migrate/create_e621_tables.rb
|
|
82
81
|
- exe/e621-export-downloader
|
|
83
82
|
- lib/e621/artist.rb
|
|
84
83
|
- lib/e621/bulk_update_request.rb
|
|
84
|
+
- lib/e621/csv_importable.rb
|
|
85
85
|
- lib/e621/pool.rb
|
|
86
86
|
- lib/e621/post.rb
|
|
87
87
|
- lib/e621/post_replacement.rb
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
class CreateE621Tables < ActiveRecord::Migration[7.1]
|
|
4
|
-
def change
|
|
5
|
-
reversible do |r|
|
|
6
|
-
r.up { execute("CREATE SCHEMA e621") }
|
|
7
|
-
r.down { execute("DROP SCHEMA e621 CASCADE") }
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
create_table(:e621_artists, id: :bigint, default: nil, force: :cascade) do |t|
|
|
11
|
-
t.datetime(:created_at, null: false)
|
|
12
|
-
t.bigint(:creator_id, null: false)
|
|
13
|
-
t.string(:group_name)
|
|
14
|
-
t.boolean(:is_active, null: false)
|
|
15
|
-
t.boolean(:is_locked, null: false)
|
|
16
|
-
t.bigint(:linked_user_id)
|
|
17
|
-
t.string(:name, null: false)
|
|
18
|
-
t.text(:other_names, array: true, null: false, default: [])
|
|
19
|
-
t.datetime(:updated_at, null: false)
|
|
20
|
-
t.text(:urls, array: true, null: false, default: [])
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
add_index(:e621_artists, :name, unique: true)
|
|
24
|
-
add_index(:e621_artists, :creator_id)
|
|
25
|
-
|
|
26
|
-
create_table(:e621_bulk_update_requests, id: :bigint, default: nil, force: :cascade) do |t|
|
|
27
|
-
t.bigint(:approver_id)
|
|
28
|
-
t.datetime(:created_at, null: false)
|
|
29
|
-
t.bigint(:forum_topic_id)
|
|
30
|
-
t.text(:script, null: false)
|
|
31
|
-
t.string(:status, null: false)
|
|
32
|
-
t.string(:title)
|
|
33
|
-
t.datetime(:updated_at, null: false)
|
|
34
|
-
t.bigint(:user_id, null: false)
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
add_index(:e621_bulk_update_requests, :user_id)
|
|
38
|
-
add_index(:e621_bulk_update_requests, :status)
|
|
39
|
-
|
|
40
|
-
create_table(:e621_pools, id: :bigint, default: nil, force: :cascade) do |t|
|
|
41
|
-
t.string(:category, null: false)
|
|
42
|
-
t.datetime(:created_at, null: false)
|
|
43
|
-
t.bigint(:creator_id, null: false)
|
|
44
|
-
t.text(:description, null: false)
|
|
45
|
-
t.boolean(:is_active, null: false)
|
|
46
|
-
t.string(:name, null: false)
|
|
47
|
-
t.bigint(:post_ids, array: true, null: false, default: [])
|
|
48
|
-
t.datetime(:updated_at)
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
add_index(:e621_pools, :creator_id)
|
|
52
|
-
add_index(:e621_pools, :name)
|
|
53
|
-
|
|
54
|
-
create_table(:e621_posts, id: :bigint, default: nil, force: :cascade) do |t|
|
|
55
|
-
t.bigint(:approver_id)
|
|
56
|
-
t.bigint(:change_seq, null: false)
|
|
57
|
-
t.integer(:comment_count, null: false)
|
|
58
|
-
t.datetime(:created_at, null: false)
|
|
59
|
-
t.text(:description, null: false)
|
|
60
|
-
t.integer(:down_score, null: false)
|
|
61
|
-
t.float(:duration)
|
|
62
|
-
t.integer(:fav_count, null: false)
|
|
63
|
-
t.string(:file_ext, null: false)
|
|
64
|
-
t.bigint(:file_size, null: false)
|
|
65
|
-
t.integer(:image_height, null: false)
|
|
66
|
-
t.integer(:image_width, null: false)
|
|
67
|
-
t.boolean(:is_deleted, null: false)
|
|
68
|
-
t.boolean(:is_flagged, null: false)
|
|
69
|
-
t.boolean(:is_note_locked, null: false)
|
|
70
|
-
t.boolean(:is_pending, null: false)
|
|
71
|
-
t.boolean(:is_rating_locked, null: false)
|
|
72
|
-
t.boolean(:is_status_locked, null: false)
|
|
73
|
-
t.text(:locked_tags, null: false)
|
|
74
|
-
t.string(:md5)
|
|
75
|
-
t.bigint(:parent_id)
|
|
76
|
-
t.string(:rating, null: false)
|
|
77
|
-
t.integer(:score, null: false)
|
|
78
|
-
t.text(:sources, array: true, null: false, default: [])
|
|
79
|
-
t.text(:tags, array: true, null: false, default: [])
|
|
80
|
-
t.integer(:up_score, null: false)
|
|
81
|
-
t.datetime(:updated_at)
|
|
82
|
-
t.bigint(:uploader_id)
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
add_index(:e621_posts, :md5, unique: true, where: "md5 IS NOT NULL")
|
|
86
|
-
add_index(:e621_posts, :uploader_id)
|
|
87
|
-
add_index(:e621_posts, :rating)
|
|
88
|
-
add_index(:e621_posts, :is_deleted)
|
|
89
|
-
|
|
90
|
-
create_table(:e621_post_replacements, id: :bigint, default: nil, force: :cascade) do |t|
|
|
91
|
-
t.bigint(:approver_id)
|
|
92
|
-
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)
|
|
101
|
-
t.text(:reason, null: false)
|
|
102
|
-
t.text(:source)
|
|
103
|
-
t.string(:status, null: false)
|
|
104
|
-
t.datetime(:updated_at, null: false)
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
add_index(:e621_post_replacements, :post_id)
|
|
108
|
-
add_index(:e621_post_replacements, :creator_id)
|
|
109
|
-
add_index(:e621_post_replacements, :status)
|
|
110
|
-
|
|
111
|
-
create_table(:e621_post_versions, id: :bigint, default: nil, force: :cascade) do |t|
|
|
112
|
-
t.text(:added_locked_tags, array: true, null: false, default: [])
|
|
113
|
-
t.text(:added_tags, array: true, null: false, default: [])
|
|
114
|
-
t.text(:description)
|
|
115
|
-
t.boolean(:description_changed, null: false)
|
|
116
|
-
t.text(:locked_tags)
|
|
117
|
-
t.boolean(:parent_changed, null: false)
|
|
118
|
-
t.bigint(:parent_id)
|
|
119
|
-
t.string(:rating)
|
|
120
|
-
t.boolean(:rating_changed, null: false)
|
|
121
|
-
t.text(:reason)
|
|
122
|
-
t.text(:removed_locked_tags, array: true, null: false, default: [])
|
|
123
|
-
t.text(:removed_tags, array: true, null: false, default: [])
|
|
124
|
-
t.text(:source)
|
|
125
|
-
t.boolean(:source_changed, null: false)
|
|
126
|
-
t.text(:tags)
|
|
127
|
-
t.datetime(:updated_at, null: false)
|
|
128
|
-
t.bigint(:updater_id, null: false)
|
|
129
|
-
t.integer(:version, null: false)
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
add_index(:e621_post_versions, :updater_id)
|
|
133
|
-
add_index(:e621_post_versions, :updated_at)
|
|
134
|
-
|
|
135
|
-
create_table(:e621_tag_aliases, id: :bigint, default: nil, force: :cascade) do |t|
|
|
136
|
-
t.string(:antecedent_name, null: false)
|
|
137
|
-
t.string(:consequent_name, null: false)
|
|
138
|
-
t.datetime(:created_at)
|
|
139
|
-
t.string(:status, null: false)
|
|
140
|
-
end
|
|
141
|
-
|
|
142
|
-
add_index(:e621_tag_aliases, :antecedent_name)
|
|
143
|
-
add_index(:e621_tag_aliases, :consequent_name)
|
|
144
|
-
add_index(:e621_tag_aliases, :status)
|
|
145
|
-
|
|
146
|
-
create_table(:e621_tag_implications, id: :bigint, default: nil, force: :cascade) do |t|
|
|
147
|
-
t.string(:antecedent_name, null: false)
|
|
148
|
-
t.string(:consequent_name, null: false)
|
|
149
|
-
t.datetime(:created_at)
|
|
150
|
-
t.string(:status, null: false)
|
|
151
|
-
end
|
|
152
|
-
|
|
153
|
-
add_index(:e621_tag_implications, :antecedent_name)
|
|
154
|
-
add_index(:e621_tag_implications, :consequent_name)
|
|
155
|
-
add_index(:e621_tag_implications, :status)
|
|
156
|
-
|
|
157
|
-
create_table(:e621_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
|
-
end
|
|
162
|
-
|
|
163
|
-
add_index(:e621_tags, :name, unique: true)
|
|
164
|
-
add_index(:e621_tags, :category)
|
|
165
|
-
|
|
166
|
-
create_table(:e621_wiki_pages, id: :bigint, default: nil, force: :cascade) do |t|
|
|
167
|
-
t.text(:body, null: false)
|
|
168
|
-
t.datetime(:created_at, null: false)
|
|
169
|
-
t.bigint(:creator_id)
|
|
170
|
-
t.boolean(:is_locked, null: false)
|
|
171
|
-
t.string(:title, null: false)
|
|
172
|
-
t.datetime(:updated_at)
|
|
173
|
-
t.bigint(:uploader_id)
|
|
174
|
-
end
|
|
175
|
-
|
|
176
|
-
add_index(:e621_wiki_pages, :title, unique: true)
|
|
177
|
-
add_index(:e621_wiki_pages, :creator_id)
|
|
178
|
-
end
|
|
179
|
-
end
|