|
|
@@ -1,6 +1,6 @@
|
|
|
|
// Code generated by sqlc. DO NOT EDIT.
|
|
|
|
// Code generated by sqlc. DO NOT EDIT.
|
|
|
|
// versions:
|
|
|
|
// versions:
|
|
|
|
// sqlc v1.30.0
|
|
|
|
// sqlc v1.31.1
|
|
|
|
// source: queries.sql
|
|
|
|
// source: queries.sql
|
|
|
|
|
|
|
|
|
|
|
|
package database
|
|
|
|
package database
|
|
|
@@ -226,6 +226,18 @@ func (q *Queries) ClearKoboShelfByName(ctx context.Context, arg ClearKoboShelfBy
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const ClearMediaItemMetadataOverrides = `-- name: ClearMediaItemMetadataOverrides :exec
|
|
|
|
|
|
|
|
UPDATE media_items SET metadata_overrides = '{}', updated_at = NOW()
|
|
|
|
|
|
|
|
WHERE id = $1
|
|
|
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Reset an item to scanned defaults: clears per-field user overrides so the
|
|
|
|
|
|
|
|
// next rescan can freely overwrite user-customized metadata.
|
|
|
|
|
|
|
|
func (q *Queries) ClearMediaItemMetadataOverrides(ctx context.Context, id pgtype.UUID) error {
|
|
|
|
|
|
|
|
_, err := q.db.Exec(ctx, ClearMediaItemMetadataOverrides, id)
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const CountAdmins = `-- name: CountAdmins :one
|
|
|
|
const CountAdmins = `-- name: CountAdmins :one
|
|
|
|
SELECT COUNT(*) FROM users WHERE role = 'admin'
|
|
|
|
SELECT COUNT(*) FROM users WHERE role = 'admin'
|
|
|
|
`
|
|
|
|
`
|
|
|
@@ -900,7 +912,7 @@ const CreateMediaItem = `-- name: CreateMediaItem :one
|
|
|
|
INSERT INTO media_items (library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, tags_search, asin, date_published, publisher, contributors, contributors_search, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, library_type_name)
|
|
|
|
INSERT INTO media_items (library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, tags_search, asin, date_published, publisher, contributors, contributors_search, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, library_type_name)
|
|
|
|
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $40, $41, $42, $43, $44)
|
|
|
|
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $40, $41, $42, $43, $44)
|
|
|
|
ON CONFLICT (library_id, file_path) DO UPDATE SET updated_at = NOW()
|
|
|
|
ON CONFLICT (library_id, file_path) DO UPDATE SET updated_at = NOW()
|
|
|
|
RETURNING id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence
|
|
|
|
RETURNING id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, metadata_overrides, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
type CreateMediaItemParams struct {
|
|
|
|
type CreateMediaItemParams struct {
|
|
|
@@ -1053,6 +1065,7 @@ func (q *Queries) CreateMediaItem(ctx context.Context, arg CreateMediaItemParams
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -2447,7 +2460,7 @@ func (q *Queries) GetAnnotationsForBook(ctx context.Context, arg GetAnnotationsF
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const GetBooksByTag = `-- name: GetBooksByTag :many
|
|
|
|
const GetBooksByTag = `-- name: GetBooksByTag :many
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, metadata_overrides, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items
|
|
|
|
WHERE library_id = $1 AND tags @> ARRAY[$2::text]
|
|
|
|
WHERE library_id = $1 AND tags @> ARRAY[$2::text]
|
|
|
|
ORDER BY title ASC
|
|
|
|
ORDER BY title ASC
|
|
|
|
`
|
|
|
|
`
|
|
|
@@ -2520,6 +2533,7 @@ func (q *Queries) GetBooksByTag(ctx context.Context, arg GetBooksByTagParams) ([
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -2619,7 +2633,7 @@ func (q *Queries) GetCollectionItems(ctx context.Context, collectionID pgtype.UU
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const GetCollectionItemsForDashboard = `-- name: GetCollectionItemsForDashboard :many
|
|
|
|
const GetCollectionItemsForDashboard = `-- name: GetCollectionItemsForDashboard :many
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence, ci.excluded FROM media_items mi
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.metadata_overrides, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence, ci.excluded FROM media_items mi
|
|
|
|
INNER JOIN collection_items ci ON ci.media_item_id = mi.id
|
|
|
|
INNER JOIN collection_items ci ON ci.media_item_id = mi.id
|
|
|
|
WHERE ci.collection_id = $1
|
|
|
|
WHERE ci.collection_id = $1
|
|
|
|
AND ($2::uuid IS NULL OR mi.library_id = $2::uuid)
|
|
|
|
AND ($2::uuid IS NULL OR mi.library_id = $2::uuid)
|
|
|
@@ -2687,6 +2701,7 @@ type GetCollectionItemsForDashboardRow struct {
|
|
|
|
AlternateInfo []byte `db:"alternate_info" json:"alternate_info"`
|
|
|
|
AlternateInfo []byte `db:"alternate_info" json:"alternate_info"`
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
|
|
|
|
MetadataOverrides []string `db:"metadata_overrides" json:"metadata_overrides"`
|
|
|
|
ChapterMetadata []byte `db:"chapter_metadata" json:"chapter_metadata"`
|
|
|
|
ChapterMetadata []byte `db:"chapter_metadata" json:"chapter_metadata"`
|
|
|
|
LibraryTypeName pgtype.Text `db:"library_type_name" json:"library_type_name"`
|
|
|
|
LibraryTypeName pgtype.Text `db:"library_type_name" json:"library_type_name"`
|
|
|
|
TagsSearch []string `db:"tags_search" json:"tags_search"`
|
|
|
|
TagsSearch []string `db:"tags_search" json:"tags_search"`
|
|
|
@@ -2761,6 +2776,7 @@ func (q *Queries) GetCollectionItemsForDashboard(ctx context.Context, arg GetCol
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -2913,7 +2929,7 @@ func (q *Queries) GetCollectionsForBook(ctx context.Context, mediaItemID pgtype.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const GetContinueReadingItems = `-- name: GetContinueReadingItems :many
|
|
|
|
const GetContinueReadingItems = `-- name: GetContinueReadingItems :many
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence FROM media_items mi
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.metadata_overrides, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence FROM media_items mi
|
|
|
|
INNER JOIN (
|
|
|
|
INNER JOIN (
|
|
|
|
SELECT DISTINCT ON (media_item_id) media_item_id, last_read_at
|
|
|
|
SELECT DISTINCT ON (media_item_id) media_item_id, last_read_at
|
|
|
|
FROM reading_progress
|
|
|
|
FROM reading_progress
|
|
|
@@ -2997,6 +3013,7 @@ func (q *Queries) GetContinueReadingItems(ctx context.Context, arg GetContinueRe
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -3030,7 +3047,7 @@ WITH user_series_progress AS (
|
|
|
|
GROUP BY mi.series
|
|
|
|
GROUP BY mi.series
|
|
|
|
),
|
|
|
|
),
|
|
|
|
next_books AS (
|
|
|
|
next_books AS (
|
|
|
|
SELECT DISTINCT ON (mi.series) mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence,
|
|
|
|
SELECT DISTINCT ON (mi.series) mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.metadata_overrides, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence,
|
|
|
|
usp.last_read_at
|
|
|
|
usp.last_read_at
|
|
|
|
FROM media_items mi
|
|
|
|
FROM media_items mi
|
|
|
|
JOIN user_series_progress usp ON mi.series = usp.series
|
|
|
|
JOIN user_series_progress usp ON mi.series = usp.series
|
|
|
@@ -3038,7 +3055,7 @@ next_books AS (
|
|
|
|
AND (mi.series_number > usp.max_read_number OR usp.max_read_number IS NULL)
|
|
|
|
AND (mi.series_number > usp.max_read_number OR usp.max_read_number IS NULL)
|
|
|
|
ORDER BY mi.series, mi.series_number ASC NULLS LAST
|
|
|
|
ORDER BY mi.series, mi.series_number ASC NULLS LAST
|
|
|
|
)
|
|
|
|
)
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence, last_read_at FROM next_books
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, metadata_overrides, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence, last_read_at FROM next_books
|
|
|
|
ORDER BY last_read_at DESC NULLS LAST
|
|
|
|
ORDER BY last_read_at DESC NULLS LAST
|
|
|
|
LIMIT $1
|
|
|
|
LIMIT $1
|
|
|
|
`
|
|
|
|
`
|
|
|
@@ -3103,6 +3120,7 @@ type GetContinueSeriesItemsRow struct {
|
|
|
|
AlternateInfo []byte `db:"alternate_info" json:"alternate_info"`
|
|
|
|
AlternateInfo []byte `db:"alternate_info" json:"alternate_info"`
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
|
|
|
|
MetadataOverrides []string `db:"metadata_overrides" json:"metadata_overrides"`
|
|
|
|
ChapterMetadata []byte `db:"chapter_metadata" json:"chapter_metadata"`
|
|
|
|
ChapterMetadata []byte `db:"chapter_metadata" json:"chapter_metadata"`
|
|
|
|
LibraryTypeName pgtype.Text `db:"library_type_name" json:"library_type_name"`
|
|
|
|
LibraryTypeName pgtype.Text `db:"library_type_name" json:"library_type_name"`
|
|
|
|
TagsSearch []string `db:"tags_search" json:"tags_search"`
|
|
|
|
TagsSearch []string `db:"tags_search" json:"tags_search"`
|
|
|
@@ -3177,6 +3195,7 @@ func (q *Queries) GetContinueSeriesItems(ctx context.Context, arg GetContinueSer
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -4306,7 +4325,7 @@ func (q *Queries) GetLibraryFolders(ctx context.Context, libraryID pgtype.UUID)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const GetLibraryItems = `-- name: GetLibraryItems :many
|
|
|
|
const GetLibraryItems = `-- name: GetLibraryItems :many
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence FROM media_items mi
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.metadata_overrides, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence FROM media_items mi
|
|
|
|
WHERE ($1::uuid IS NULL OR mi.library_id = $1::uuid)
|
|
|
|
WHERE ($1::uuid IS NULL OR mi.library_id = $1::uuid)
|
|
|
|
ORDER BY mi.created_at DESC
|
|
|
|
ORDER BY mi.created_at DESC
|
|
|
|
`
|
|
|
|
`
|
|
|
@@ -4374,6 +4393,7 @@ func (q *Queries) GetLibraryItems(ctx context.Context, libraryID pgtype.UUID) ([
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -4805,7 +4825,7 @@ func (q *Queries) GetMediaHighlights(ctx context.Context, arg GetMediaHighlights
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const GetMediaItem = `-- name: GetMediaItem :one
|
|
|
|
const GetMediaItem = `-- name: GetMediaItem :one
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE id = $1
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, metadata_overrides, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE id = $1
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
func (q *Queries) GetMediaItem(ctx context.Context, id pgtype.UUID) (MediaItems, error) {
|
|
|
|
func (q *Queries) GetMediaItem(ctx context.Context, id pgtype.UUID) (MediaItems, error) {
|
|
|
@@ -4865,6 +4885,7 @@ func (q *Queries) GetMediaItem(ctx context.Context, id pgtype.UUID) (MediaItems,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -4878,7 +4899,7 @@ func (q *Queries) GetMediaItem(ctx context.Context, id pgtype.UUID) (MediaItems,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const GetMediaItemByFilePath = `-- name: GetMediaItemByFilePath :one
|
|
|
|
const GetMediaItemByFilePath = `-- name: GetMediaItemByFilePath :one
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE file_path = $1 AND library_id = $2
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, metadata_overrides, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE file_path = $1 AND library_id = $2
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
type GetMediaItemByFilePathParams struct {
|
|
|
|
type GetMediaItemByFilePathParams struct {
|
|
|
@@ -4943,6 +4964,7 @@ func (q *Queries) GetMediaItemByFilePath(ctx context.Context, arg GetMediaItemBy
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -4956,7 +4978,7 @@ func (q *Queries) GetMediaItemByFilePath(ctx context.Context, arg GetMediaItemBy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const GetMediaItemByFilePathAnyLibrary = `-- name: GetMediaItemByFilePathAnyLibrary :one
|
|
|
|
const GetMediaItemByFilePathAnyLibrary = `-- name: GetMediaItemByFilePathAnyLibrary :one
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE file_path = $1 LIMIT 1
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, metadata_overrides, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE file_path = $1 LIMIT 1
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
func (q *Queries) GetMediaItemByFilePathAnyLibrary(ctx context.Context, filePath string) (MediaItems, error) {
|
|
|
|
func (q *Queries) GetMediaItemByFilePathAnyLibrary(ctx context.Context, filePath string) (MediaItems, error) {
|
|
|
@@ -5016,6 +5038,7 @@ func (q *Queries) GetMediaItemByFilePathAnyLibrary(ctx context.Context, filePath
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -5030,7 +5053,7 @@ func (q *Queries) GetMediaItemByFilePathAnyLibrary(ctx context.Context, filePath
|
|
|
|
|
|
|
|
|
|
|
|
const GetMediaItemByFilePathForSync = `-- name: GetMediaItemByFilePathForSync :one
|
|
|
|
const GetMediaItemByFilePathForSync = `-- name: GetMediaItemByFilePathForSync :one
|
|
|
|
|
|
|
|
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE file_path = $1
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, metadata_overrides, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE file_path = $1
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
// ============================================
|
|
|
|
// ============================================
|
|
|
@@ -5093,6 +5116,7 @@ func (q *Queries) GetMediaItemByFilePathForSync(ctx context.Context, filePath st
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -5106,7 +5130,7 @@ func (q *Queries) GetMediaItemByFilePathForSync(ctx context.Context, filePath st
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const GetMediaItemByKoboContentId = `-- name: GetMediaItemByKoboContentId :one
|
|
|
|
const GetMediaItemByKoboContentId = `-- name: GetMediaItemByKoboContentId :one
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE kobo_content_id = $1
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, metadata_overrides, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE kobo_content_id = $1
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
func (q *Queries) GetMediaItemByKoboContentId(ctx context.Context, koboContentID pgtype.Text) (MediaItems, error) {
|
|
|
|
func (q *Queries) GetMediaItemByKoboContentId(ctx context.Context, koboContentID pgtype.Text) (MediaItems, error) {
|
|
|
@@ -5166,6 +5190,7 @@ func (q *Queries) GetMediaItemByKoboContentId(ctx context.Context, koboContentID
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -5179,7 +5204,7 @@ func (q *Queries) GetMediaItemByKoboContentId(ctx context.Context, koboContentID
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const GetMediaItemByOPFIdentifier = `-- name: GetMediaItemByOPFIdentifier :one
|
|
|
|
const GetMediaItemByOPFIdentifier = `-- name: GetMediaItemByOPFIdentifier :one
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE opf_identifier = $1
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, metadata_overrides, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE opf_identifier = $1
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
// Get media item by OPF identifier
|
|
|
|
// Get media item by OPF identifier
|
|
|
@@ -5240,6 +5265,7 @@ func (q *Queries) GetMediaItemByOPFIdentifier(ctx context.Context, opfIdentifier
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -5253,7 +5279,7 @@ func (q *Queries) GetMediaItemByOPFIdentifier(ctx context.Context, opfIdentifier
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const GetMediaItemByOPFUUID = `-- name: GetMediaItemByOPFUUID :one
|
|
|
|
const GetMediaItemByOPFUUID = `-- name: GetMediaItemByOPFUUID :one
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE opf_uuid = $1
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, metadata_overrides, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE opf_uuid = $1
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
// Get media item by OPF UUID
|
|
|
|
// Get media item by OPF UUID
|
|
|
@@ -5314,6 +5340,7 @@ func (q *Queries) GetMediaItemByOPFUUID(ctx context.Context, opfUuid pgtype.Text
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -5327,7 +5354,7 @@ func (q *Queries) GetMediaItemByOPFUUID(ctx context.Context, opfUuid pgtype.Text
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const GetMediaItemBySHA256 = `-- name: GetMediaItemBySHA256 :one
|
|
|
|
const GetMediaItemBySHA256 = `-- name: GetMediaItemBySHA256 :one
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE file_sha256 = $1
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, metadata_overrides, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE file_sha256 = $1
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
// Get media item by SHA-256 hash
|
|
|
|
// Get media item by SHA-256 hash
|
|
|
@@ -5388,6 +5415,7 @@ func (q *Queries) GetMediaItemBySHA256(ctx context.Context, fileSha256 pgtype.Te
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -5401,7 +5429,7 @@ func (q *Queries) GetMediaItemBySHA256(ctx context.Context, fileSha256 pgtype.Te
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const GetMediaItemBySHA256AndLibrary = `-- name: GetMediaItemBySHA256AndLibrary :one
|
|
|
|
const GetMediaItemBySHA256AndLibrary = `-- name: GetMediaItemBySHA256AndLibrary :one
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE file_sha256 = $1 AND library_id = $2
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, metadata_overrides, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE file_sha256 = $1 AND library_id = $2
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
type GetMediaItemBySHA256AndLibraryParams struct {
|
|
|
|
type GetMediaItemBySHA256AndLibraryParams struct {
|
|
|
@@ -5467,6 +5495,7 @@ func (q *Queries) GetMediaItemBySHA256AndLibrary(ctx context.Context, arg GetMed
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -5807,7 +5836,7 @@ func (q *Queries) GetNextRetryTime(ctx context.Context) (interface{}, error) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const GetNotStartedItems = `-- name: GetNotStartedItems :many
|
|
|
|
const GetNotStartedItems = `-- name: GetNotStartedItems :many
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence FROM media_items mi
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.metadata_overrides, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence FROM media_items mi
|
|
|
|
WHERE ($1::uuid IS NULL OR mi.library_id = $1::uuid)
|
|
|
|
WHERE ($1::uuid IS NULL OR mi.library_id = $1::uuid)
|
|
|
|
AND NOT EXISTS (
|
|
|
|
AND NOT EXISTS (
|
|
|
|
SELECT 1 FROM reading_progress rp
|
|
|
|
SELECT 1 FROM reading_progress rp
|
|
|
@@ -5888,6 +5917,7 @@ func (q *Queries) GetNotStartedItems(ctx context.Context, arg GetNotStartedItems
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -6207,7 +6237,7 @@ func (q *Queries) GetReadingSpeed(ctx context.Context, arg GetReadingSpeedParams
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const GetRecentlyAddedItems = `-- name: GetRecentlyAddedItems :many
|
|
|
|
const GetRecentlyAddedItems = `-- name: GetRecentlyAddedItems :many
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence FROM media_items mi
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.metadata_overrides, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence FROM media_items mi
|
|
|
|
WHERE ($1::uuid IS NULL OR mi.library_id = $1::uuid)
|
|
|
|
WHERE ($1::uuid IS NULL OR mi.library_id = $1::uuid)
|
|
|
|
ORDER BY mi.imported_at DESC NULLS LAST, mi.created_at DESC
|
|
|
|
ORDER BY mi.imported_at DESC NULLS LAST, mi.created_at DESC
|
|
|
|
LIMIT $2
|
|
|
|
LIMIT $2
|
|
|
@@ -6281,6 +6311,7 @@ func (q *Queries) GetRecentlyAddedItems(ctx context.Context, arg GetRecentlyAdde
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -6301,7 +6332,7 @@ func (q *Queries) GetRecentlyAddedItems(ctx context.Context, arg GetRecentlyAdde
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const GetRecentlyReadItems = `-- name: GetRecentlyReadItems :many
|
|
|
|
const GetRecentlyReadItems = `-- name: GetRecentlyReadItems :many
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence FROM media_items mi
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.metadata_overrides, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence FROM media_items mi
|
|
|
|
INNER JOIN (
|
|
|
|
INNER JOIN (
|
|
|
|
SELECT DISTINCT ON (media_item_id) media_item_id, last_read_at
|
|
|
|
SELECT DISTINCT ON (media_item_id) media_item_id, last_read_at
|
|
|
|
FROM reading_progress
|
|
|
|
FROM reading_progress
|
|
|
@@ -6383,6 +6414,7 @@ func (q *Queries) GetRecentlyReadItems(ctx context.Context, arg GetRecentlyReadI
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -6503,7 +6535,7 @@ func (q *Queries) GetSavedFilters(ctx context.Context, arg GetSavedFiltersParams
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const GetSeriesBooks = `-- name: GetSeriesBooks :many
|
|
|
|
const GetSeriesBooks = `-- name: GetSeriesBooks :many
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, metadata_overrides, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items
|
|
|
|
WHERE series = $1
|
|
|
|
WHERE series = $1
|
|
|
|
ORDER BY series_number ASC NULLS LAST
|
|
|
|
ORDER BY series_number ASC NULLS LAST
|
|
|
|
`
|
|
|
|
`
|
|
|
@@ -6571,6 +6603,7 @@ func (q *Queries) GetSeriesBooks(ctx context.Context, series pgtype.Text) ([]Med
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -8354,7 +8387,7 @@ func (q *Queries) ListLibraries(ctx context.Context) ([]ListLibrariesRow, error)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const ListMediaItems = `-- name: ListMediaItems :many
|
|
|
|
const ListMediaItems = `-- name: ListMediaItems :many
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence, l.name as library_name, lt.name as library_type_name
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.metadata_overrides, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence, l.name as library_name, lt.name as library_type_name
|
|
|
|
FROM media_items mi
|
|
|
|
FROM media_items mi
|
|
|
|
JOIN libraries l ON mi.library_id = l.id
|
|
|
|
JOIN libraries l ON mi.library_id = l.id
|
|
|
|
JOIN library_types lt ON l.library_type_id = lt.id
|
|
|
|
JOIN library_types lt ON l.library_type_id = lt.id
|
|
|
@@ -8420,6 +8453,7 @@ type ListMediaItemsRow struct {
|
|
|
|
AlternateInfo []byte `db:"alternate_info" json:"alternate_info"`
|
|
|
|
AlternateInfo []byte `db:"alternate_info" json:"alternate_info"`
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
|
|
|
|
MetadataOverrides []string `db:"metadata_overrides" json:"metadata_overrides"`
|
|
|
|
ChapterMetadata []byte `db:"chapter_metadata" json:"chapter_metadata"`
|
|
|
|
ChapterMetadata []byte `db:"chapter_metadata" json:"chapter_metadata"`
|
|
|
|
LibraryTypeName pgtype.Text `db:"library_type_name" json:"library_type_name"`
|
|
|
|
LibraryTypeName pgtype.Text `db:"library_type_name" json:"library_type_name"`
|
|
|
|
TagsSearch []string `db:"tags_search" json:"tags_search"`
|
|
|
|
TagsSearch []string `db:"tags_search" json:"tags_search"`
|
|
|
@@ -8495,6 +8529,7 @@ func (q *Queries) ListMediaItems(ctx context.Context, arg ListMediaItemsParams)
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -8517,7 +8552,7 @@ func (q *Queries) ListMediaItems(ctx context.Context, arg ListMediaItemsParams)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const ListMediaItemsByLibrary = `-- name: ListMediaItemsByLibrary :many
|
|
|
|
const ListMediaItemsByLibrary = `-- name: ListMediaItemsByLibrary :many
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence, l.name as library_name, lt.name as library_type_name
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.metadata_overrides, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence, l.name as library_name, lt.name as library_type_name
|
|
|
|
FROM media_items mi
|
|
|
|
FROM media_items mi
|
|
|
|
JOIN libraries l ON mi.library_id = l.id
|
|
|
|
JOIN libraries l ON mi.library_id = l.id
|
|
|
|
JOIN library_types lt ON l.library_type_id = lt.id
|
|
|
|
JOIN library_types lt ON l.library_type_id = lt.id
|
|
|
@@ -8579,6 +8614,7 @@ type ListMediaItemsByLibraryRow struct {
|
|
|
|
AlternateInfo []byte `db:"alternate_info" json:"alternate_info"`
|
|
|
|
AlternateInfo []byte `db:"alternate_info" json:"alternate_info"`
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
|
|
|
|
MetadataOverrides []string `db:"metadata_overrides" json:"metadata_overrides"`
|
|
|
|
ChapterMetadata []byte `db:"chapter_metadata" json:"chapter_metadata"`
|
|
|
|
ChapterMetadata []byte `db:"chapter_metadata" json:"chapter_metadata"`
|
|
|
|
LibraryTypeName pgtype.Text `db:"library_type_name" json:"library_type_name"`
|
|
|
|
LibraryTypeName pgtype.Text `db:"library_type_name" json:"library_type_name"`
|
|
|
|
TagsSearch []string `db:"tags_search" json:"tags_search"`
|
|
|
|
TagsSearch []string `db:"tags_search" json:"tags_search"`
|
|
|
@@ -8654,6 +8690,7 @@ func (q *Queries) ListMediaItemsByLibrary(ctx context.Context, libraryID pgtype.
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -8676,7 +8713,7 @@ func (q *Queries) ListMediaItemsByLibrary(ctx context.Context, libraryID pgtype.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const ListMediaItemsBySHA256AndLibrary = `-- name: ListMediaItemsBySHA256AndLibrary :many
|
|
|
|
const ListMediaItemsBySHA256AndLibrary = `-- name: ListMediaItemsBySHA256AndLibrary :many
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE file_sha256 = $1 AND library_id = $2 ORDER BY file_path
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, metadata_overrides, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE file_sha256 = $1 AND library_id = $2 ORDER BY file_path
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
type ListMediaItemsBySHA256AndLibraryParams struct {
|
|
|
|
type ListMediaItemsBySHA256AndLibraryParams struct {
|
|
|
@@ -8748,6 +8785,7 @@ func (q *Queries) ListMediaItemsBySHA256AndLibrary(ctx context.Context, arg List
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -8768,7 +8806,7 @@ func (q *Queries) ListMediaItemsBySHA256AndLibrary(ctx context.Context, arg List
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const ListMediaItemsMissingHash = `-- name: ListMediaItemsMissingHash :many
|
|
|
|
const ListMediaItemsMissingHash = `-- name: ListMediaItemsMissingHash :many
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE file_sha256 IS NULL ORDER BY created_at
|
|
|
|
SELECT id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, metadata_overrides, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence FROM media_items WHERE file_sha256 IS NULL ORDER BY created_at
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
// List media items that have no stored SHA-256 (imported before hashing existed)
|
|
|
|
// List media items that have no stored SHA-256 (imported before hashing existed)
|
|
|
@@ -8835,6 +8873,7 @@ func (q *Queries) ListMediaItemsMissingHash(ctx context.Context) ([]MediaItems,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -8855,7 +8894,7 @@ func (q *Queries) ListMediaItemsMissingHash(ctx context.Context) ([]MediaItems,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const ListMediaItemsSorted = `-- name: ListMediaItemsSorted :many
|
|
|
|
const ListMediaItemsSorted = `-- name: ListMediaItemsSorted :many
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence, l.name as library_name, lt.name as library_type_name
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.metadata_overrides, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence, l.name as library_name, lt.name as library_type_name
|
|
|
|
FROM media_items mi
|
|
|
|
FROM media_items mi
|
|
|
|
JOIN libraries l ON mi.library_id = l.id
|
|
|
|
JOIN libraries l ON mi.library_id = l.id
|
|
|
|
JOIN library_types lt ON l.library_type_id = lt.id
|
|
|
|
JOIN library_types lt ON l.library_type_id = lt.id
|
|
|
@@ -8990,6 +9029,7 @@ type ListMediaItemsSortedRow struct {
|
|
|
|
AlternateInfo []byte `db:"alternate_info" json:"alternate_info"`
|
|
|
|
AlternateInfo []byte `db:"alternate_info" json:"alternate_info"`
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
|
|
|
|
MetadataOverrides []string `db:"metadata_overrides" json:"metadata_overrides"`
|
|
|
|
ChapterMetadata []byte `db:"chapter_metadata" json:"chapter_metadata"`
|
|
|
|
ChapterMetadata []byte `db:"chapter_metadata" json:"chapter_metadata"`
|
|
|
|
LibraryTypeName pgtype.Text `db:"library_type_name" json:"library_type_name"`
|
|
|
|
LibraryTypeName pgtype.Text `db:"library_type_name" json:"library_type_name"`
|
|
|
|
TagsSearch []string `db:"tags_search" json:"tags_search"`
|
|
|
|
TagsSearch []string `db:"tags_search" json:"tags_search"`
|
|
|
@@ -9070,6 +9110,7 @@ func (q *Queries) ListMediaItemsSorted(ctx context.Context, arg ListMediaItemsSo
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -10193,7 +10234,7 @@ func (q *Queries) SearchLanguageValues(ctx context.Context, arg SearchLanguageVa
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const SearchMediaItems = `-- name: SearchMediaItems :many
|
|
|
|
const SearchMediaItems = `-- name: SearchMediaItems :many
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence, l.name as library_name, lt.name as library_type_name
|
|
|
|
SELECT mi.id, mi.library_id, mi.title, mi.author, mi.isbn, mi.description, mi.file_path, mi.file_size, mi.mime_type, mi.cover_image_path, mi.series, mi.series_number, mi.tags, mi.asin, mi.date_published, mi.publisher, mi.contributors, mi.language, mi.edition, mi.page_count, mi.genre, mi.copyright_year, mi.goodreads_id, mi.openlibrary_id, mi.google_books_id, mi.added_by_admin_id, mi.created_at, mi.imported_at, mi.updated_at, mi.format_group, mi.format_mimetype, mi.is_reflowable, mi.has_fixed_layout, mi.total_characters, mi.chapter_count, mi.entitlement_id, mi.revision_number, mi.kobo_content_id, mi.kobo_metadata, mi.manga_type, mi.reading_direction, mi.series_count, mi.volume, mi.imprint, mi.age_rating, mi.web_url, mi.story_arc, mi.is_black_and_white, mi.metadata_notes, mi.community_rating, mi.alternate_info, mi.scan_information, mi.summary, mi.metadata_overrides, mi.chapter_metadata, mi.library_type_name, mi.tags_search, mi.contributors_search, mi.file_sha256, mi.opf_identifier, mi.opf_uuid, mi.hash_confidence, l.name as library_name, lt.name as library_type_name
|
|
|
|
FROM media_items mi
|
|
|
|
FROM media_items mi
|
|
|
|
JOIN libraries l ON mi.library_id = l.id
|
|
|
|
JOIN libraries l ON mi.library_id = l.id
|
|
|
|
JOIN library_types lt ON l.library_type_id = lt.id
|
|
|
|
JOIN library_types lt ON l.library_type_id = lt.id
|
|
|
@@ -10281,6 +10322,7 @@ type SearchMediaItemsRow struct {
|
|
|
|
AlternateInfo []byte `db:"alternate_info" json:"alternate_info"`
|
|
|
|
AlternateInfo []byte `db:"alternate_info" json:"alternate_info"`
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
|
|
|
|
MetadataOverrides []string `db:"metadata_overrides" json:"metadata_overrides"`
|
|
|
|
ChapterMetadata []byte `db:"chapter_metadata" json:"chapter_metadata"`
|
|
|
|
ChapterMetadata []byte `db:"chapter_metadata" json:"chapter_metadata"`
|
|
|
|
LibraryTypeName pgtype.Text `db:"library_type_name" json:"library_type_name"`
|
|
|
|
LibraryTypeName pgtype.Text `db:"library_type_name" json:"library_type_name"`
|
|
|
|
TagsSearch []string `db:"tags_search" json:"tags_search"`
|
|
|
|
TagsSearch []string `db:"tags_search" json:"tags_search"`
|
|
|
@@ -10363,6 +10405,7 @@ func (q *Queries) SearchMediaItems(ctx context.Context, arg SearchMediaItemsPara
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -11834,9 +11877,10 @@ UPDATE media_items SET
|
|
|
|
alternate_info = $35,
|
|
|
|
alternate_info = $35,
|
|
|
|
scan_information = $36,
|
|
|
|
scan_information = $36,
|
|
|
|
summary = $37,
|
|
|
|
summary = $37,
|
|
|
|
|
|
|
|
metadata_overrides = $38,
|
|
|
|
updated_at = NOW()
|
|
|
|
updated_at = NOW()
|
|
|
|
WHERE id = $1
|
|
|
|
WHERE id = $1
|
|
|
|
RETURNING id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence
|
|
|
|
RETURNING id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, metadata_overrides, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
type UpdateMediaItemParams struct {
|
|
|
|
type UpdateMediaItemParams struct {
|
|
|
@@ -11877,6 +11921,7 @@ type UpdateMediaItemParams struct {
|
|
|
|
AlternateInfo []byte `db:"alternate_info" json:"alternate_info"`
|
|
|
|
AlternateInfo []byte `db:"alternate_info" json:"alternate_info"`
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
|
|
|
|
MetadataOverrides []string `db:"metadata_overrides" json:"metadata_overrides"`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (q *Queries) UpdateMediaItem(ctx context.Context, arg UpdateMediaItemParams) (MediaItems, error) {
|
|
|
|
func (q *Queries) UpdateMediaItem(ctx context.Context, arg UpdateMediaItemParams) (MediaItems, error) {
|
|
|
@@ -11918,6 +11963,7 @@ func (q *Queries) UpdateMediaItem(ctx context.Context, arg UpdateMediaItemParams
|
|
|
|
arg.AlternateInfo,
|
|
|
|
arg.AlternateInfo,
|
|
|
|
arg.ScanInformation,
|
|
|
|
arg.ScanInformation,
|
|
|
|
arg.Summary,
|
|
|
|
arg.Summary,
|
|
|
|
|
|
|
|
arg.MetadataOverrides,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
var i MediaItems
|
|
|
|
var i MediaItems
|
|
|
|
err := row.Scan(
|
|
|
|
err := row.Scan(
|
|
|
@@ -11974,6 +12020,7 @@ func (q *Queries) UpdateMediaItem(ctx context.Context, arg UpdateMediaItemParams
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -11990,7 +12037,7 @@ const UpdateMediaItemChapterMetadata = `-- name: UpdateMediaItemChapterMetadata
|
|
|
|
UPDATE media_items
|
|
|
|
UPDATE media_items
|
|
|
|
SET chapter_metadata = $2, updated_at = NOW()
|
|
|
|
SET chapter_metadata = $2, updated_at = NOW()
|
|
|
|
WHERE id = $1
|
|
|
|
WHERE id = $1
|
|
|
|
RETURNING id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence
|
|
|
|
RETURNING id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, metadata_overrides, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
type UpdateMediaItemChapterMetadataParams struct {
|
|
|
|
type UpdateMediaItemChapterMetadataParams struct {
|
|
|
@@ -12055,6 +12102,7 @@ func (q *Queries) UpdateMediaItemChapterMetadata(ctx context.Context, arg Update
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -12162,7 +12210,7 @@ SET
|
|
|
|
hash_confidence = $5,
|
|
|
|
hash_confidence = $5,
|
|
|
|
updated_at = NOW()
|
|
|
|
updated_at = NOW()
|
|
|
|
WHERE id = $1
|
|
|
|
WHERE id = $1
|
|
|
|
RETURNING id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence
|
|
|
|
RETURNING id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, metadata_overrides, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
type UpdateMediaItemIdentifiersParams struct {
|
|
|
|
type UpdateMediaItemIdentifiersParams struct {
|
|
|
@@ -12241,6 +12289,7 @@ func (q *Queries) UpdateMediaItemIdentifiers(ctx context.Context, arg UpdateMedi
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
@@ -12261,7 +12310,7 @@ SET entitlement_id = $2,
|
|
|
|
kobo_metadata = $5,
|
|
|
|
kobo_metadata = $5,
|
|
|
|
updated_at = NOW()
|
|
|
|
updated_at = NOW()
|
|
|
|
WHERE id = $1
|
|
|
|
WHERE id = $1
|
|
|
|
RETURNING id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence
|
|
|
|
RETURNING id, library_id, title, author, isbn, description, file_path, file_size, mime_type, cover_image_path, series, series_number, tags, asin, date_published, publisher, contributors, language, edition, page_count, genre, copyright_year, goodreads_id, openlibrary_id, google_books_id, added_by_admin_id, created_at, imported_at, updated_at, format_group, format_mimetype, is_reflowable, has_fixed_layout, total_characters, chapter_count, entitlement_id, revision_number, kobo_content_id, kobo_metadata, manga_type, reading_direction, series_count, volume, imprint, age_rating, web_url, story_arc, is_black_and_white, metadata_notes, community_rating, alternate_info, scan_information, summary, metadata_overrides, chapter_metadata, library_type_name, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
type UpdateMediaItemKoboMetadataParams struct {
|
|
|
|
type UpdateMediaItemKoboMetadataParams struct {
|
|
|
@@ -12335,6 +12384,7 @@ func (q *Queries) UpdateMediaItemKoboMetadata(ctx context.Context, arg UpdateMed
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.AlternateInfo,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.ScanInformation,
|
|
|
|
&i.Summary,
|
|
|
|
&i.Summary,
|
|
|
|
|
|
|
|
&i.MetadataOverrides,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
&i.TagsSearch,
|
|
|
|
&i.TagsSearch,
|
|
|
|