diff --git a/lib/PoorBooru/API/V0/Controller/Media.pm b/lib/PoorBooru/API/V0/Controller/Media.pm index a852216..05dcaa1 100644 --- a/lib/PoorBooru/API/V0/Controller/Media.pm +++ b/lib/PoorBooru/API/V0/Controller/Media.pm @@ -4,7 +4,6 @@ use strict; use warnings; use Mojo::Base "Mojolicious::Controller"; -use SeaweedFS::FID; my $MEDIA_SEARCH_OPTS = { order_by => { -desc => "media_id" }, @@ -32,7 +31,7 @@ sub list ($self) ->search({}, $MEDIA_SEARCH_OPTS)->page($page); my @media = map +{ media_id => $_->media_id, - seaweedfs_fid => SeaweedFS::FID->from_bin($_->seaweedfs_fid), + seaweedfs_fid => $_->seaweedfs_fid, }, $paged_media->all; return $self->render(json => { diff --git a/lib/PoorBooru/API/V0/Controller/Tags.pm b/lib/PoorBooru/API/V0/Controller/Tags.pm index 45db618..cde4e6d 100644 --- a/lib/PoorBooru/API/V0/Controller/Tags.pm +++ b/lib/PoorBooru/API/V0/Controller/Tags.pm @@ -76,7 +76,7 @@ sub show ($self) ->page($page); my @media = map +{ media_id => $_->media_id, - seaweedfs_fid => SeaweedFS::FID->from_bin($_->media_seaweedfs_fid), + seaweedfs_fid => $_->media_seaweedfs_fid, }, $paged_media->all; return $self->render(json => { diff --git a/lib/PoorBooru/Schema/Result/Media.pm b/lib/PoorBooru/Schema/Result/Media.pm index 7259455..c4cfb4a 100644 --- a/lib/PoorBooru/Schema/Result/Media.pm +++ b/lib/PoorBooru/Schema/Result/Media.pm @@ -31,9 +31,9 @@ __PACKAGE__->table("media"); =head2 seaweedfs_fid - data_type: 'blob' + data_type: 'text' is_nullable: 0 - size: 32 + size: 35 =head2 filename @@ -53,7 +53,7 @@ __PACKAGE__->add_columns( "media_id", { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, "seaweedfs_fid", - { data_type => "blob", is_nullable => 0, size => 32 }, + { data_type => "text", is_nullable => 0, size => 35 }, "filename", { data_type => "text", is_nullable => 0, size => 256 }, "content_type", @@ -100,8 +100,8 @@ Composing rels: L -> tag __PACKAGE__->many_to_many("tags", "media_tags", "tag"); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-03-05 13:14:18 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gY4mMvaQ+cUpA3gtQc9pjg +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-03-06 09:09:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kIWqStRENiX11XbLnnhJkg # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/migrations/1_up.sql b/migrations/1_up.sql index 852b2a4..32d6431 100644 --- a/migrations/1_up.sql +++ b/migrations/1_up.sql @@ -1,6 +1,6 @@ CREATE TABLE media( media_id INTEGER PRIMARY KEY, - seaweedfs_fid BLOB (32) NOT NULL, + seaweedfs_fid TEXT (35) NOT NULL, filename TEXT (256) NOT NULL, content_type TEXT (256) );