|
|
|
@@ -629,9 +629,9 @@ func (q *Queries) CreateMediaHighlight(ctx context.Context, arg CreateMediaHighl
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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, 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)
|
|
|
|
|
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)
|
|
|
|
|
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, 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, tags_search, contributors_search, file_sha256, opf_identifier, opf_uuid, hash_confidence
|
|
|
|
|
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, 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)
|
|
|
|
|
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, 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
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
type CreateMediaItemParams struct {
|
|
|
|
@@ -677,6 +677,7 @@ type CreateMediaItemParams struct {
|
|
|
|
|
AlternateInfo []byte `db:"alternate_info" json:"alternate_info"`
|
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
|
LibraryTypeName pgtype.Text `db:"library_type_name" json:"library_type_name"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Media Items queries
|
|
|
|
@@ -724,6 +725,7 @@ func (q *Queries) CreateMediaItem(ctx context.Context, arg CreateMediaItemParams
|
|
|
|
|
arg.AlternateInfo,
|
|
|
|
|
arg.ScanInformation,
|
|
|
|
|
arg.Summary,
|
|
|
|
|
arg.LibraryTypeName,
|
|
|
|
|
)
|
|
|
|
|
var i MediaItems
|
|
|
|
|
err := row.Scan(
|
|
|
|
@@ -780,6 +782,7 @@ func (q *Queries) CreateMediaItem(ctx context.Context, arg CreateMediaItemParams
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -1923,7 +1926,7 @@ func (q *Queries) GetCollectionItems(ctx context.Context, collectionID pgtype.UU
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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.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.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.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
|
|
|
|
|
INNER JOIN collection_items ci ON ci.media_item_id = mi.id
|
|
|
|
|
WHERE ci.collection_id = $1
|
|
|
|
|
AND mi.library_id = $2
|
|
|
|
@@ -1991,6 +1994,7 @@ type GetCollectionItemsForDashboardRow struct {
|
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
|
ChapterMetadata []byte `db:"chapter_metadata" json:"chapter_metadata"`
|
|
|
|
|
LibraryTypeName pgtype.Text `db:"library_type_name" json:"library_type_name"`
|
|
|
|
|
TagsSearch []string `db:"tags_search" json:"tags_search"`
|
|
|
|
|
ContributorsSearch []string `db:"contributors_search" json:"contributors_search"`
|
|
|
|
|
FileSha256 pgtype.Text `db:"file_sha256" json:"file_sha256"`
|
|
|
|
@@ -2063,6 +2067,7 @@ func (q *Queries) GetCollectionItemsForDashboard(ctx context.Context, arg GetCol
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -2213,7 +2218,7 @@ func (q *Queries) GetCollectionsForBook(ctx context.Context, mediaItemID pgtype.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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.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.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.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
|
|
|
|
|
INNER JOIN (
|
|
|
|
|
SELECT DISTINCT ON (media_item_id) media_item_id, last_read_at
|
|
|
|
|
FROM reading_progress
|
|
|
|
@@ -2297,6 +2302,7 @@ func (q *Queries) GetContinueReadingItems(ctx context.Context, arg GetContinueRe
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -3252,7 +3258,7 @@ func (q *Queries) GetLibraryFolders(ctx context.Context, libraryID pgtype.UUID)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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.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.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.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
|
|
|
|
|
WHERE mi.library_id = $1
|
|
|
|
|
ORDER BY mi.created_at DESC
|
|
|
|
|
`
|
|
|
|
@@ -3320,6 +3326,7 @@ func (q *Queries) GetLibraryItems(ctx context.Context, libraryID pgtype.UUID) ([
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -3552,7 +3559,7 @@ func (q *Queries) GetMediaHighlights(ctx context.Context, arg GetMediaHighlights
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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, 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, 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, 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
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
func (q *Queries) GetMediaItem(ctx context.Context, id pgtype.UUID) (MediaItems, error) {
|
|
|
|
@@ -3612,6 +3619,7 @@ func (q *Queries) GetMediaItem(ctx context.Context, id pgtype.UUID) (MediaItems,
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -3623,7 +3631,7 @@ func (q *Queries) GetMediaItem(ctx context.Context, id pgtype.UUID) (MediaItems,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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, 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, 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, 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
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
type GetMediaItemByFilePathParams struct {
|
|
|
|
@@ -3688,6 +3696,7 @@ func (q *Queries) GetMediaItemByFilePath(ctx context.Context, arg GetMediaItemBy
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -3699,7 +3708,7 @@ func (q *Queries) GetMediaItemByFilePath(ctx context.Context, arg GetMediaItemBy
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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, 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, 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, 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
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
func (q *Queries) GetMediaItemByFilePathAnyLibrary(ctx context.Context, filePath string) (MediaItems, error) {
|
|
|
|
@@ -3759,6 +3768,7 @@ func (q *Queries) GetMediaItemByFilePathAnyLibrary(ctx context.Context, filePath
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -3771,7 +3781,7 @@ func (q *Queries) GetMediaItemByFilePathAnyLibrary(ctx context.Context, filePath
|
|
|
|
|
|
|
|
|
|
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, 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, 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, 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
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
// ============================================
|
|
|
|
@@ -3834,6 +3844,7 @@ func (q *Queries) GetMediaItemByFilePathForSync(ctx context.Context, filePath st
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -3845,7 +3856,7 @@ func (q *Queries) GetMediaItemByFilePathForSync(ctx context.Context, filePath st
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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, 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, 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, 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
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
func (q *Queries) GetMediaItemByKoboContentId(ctx context.Context, koboContentID pgtype.Text) (MediaItems, error) {
|
|
|
|
@@ -3905,6 +3916,7 @@ func (q *Queries) GetMediaItemByKoboContentId(ctx context.Context, koboContentID
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -3916,7 +3928,7 @@ func (q *Queries) GetMediaItemByKoboContentId(ctx context.Context, koboContentID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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, 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, 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, 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
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
// Get media item by OPF identifier
|
|
|
|
@@ -3977,6 +3989,7 @@ func (q *Queries) GetMediaItemByOPFIdentifier(ctx context.Context, opfIdentifier
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -3988,7 +4001,7 @@ func (q *Queries) GetMediaItemByOPFIdentifier(ctx context.Context, opfIdentifier
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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, 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, 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, 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
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
// Get media item by OPF UUID
|
|
|
|
@@ -4049,6 +4062,7 @@ func (q *Queries) GetMediaItemByOPFUUID(ctx context.Context, opfUuid pgtype.Text
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -4060,7 +4074,7 @@ func (q *Queries) GetMediaItemByOPFUUID(ctx context.Context, opfUuid pgtype.Text
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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, 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, 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, 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
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
// Get media item by SHA-256 hash
|
|
|
|
@@ -4121,6 +4135,7 @@ func (q *Queries) GetMediaItemBySHA256(ctx context.Context, fileSha256 pgtype.Te
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -4374,7 +4389,7 @@ func (q *Queries) GetNextRetryTime(ctx context.Context) (interface{}, error) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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.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.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.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
|
|
|
|
|
WHERE mi.library_id = $1
|
|
|
|
|
AND NOT EXISTS (
|
|
|
|
|
SELECT 1 FROM reading_progress rp
|
|
|
|
@@ -4455,6 +4470,7 @@ func (q *Queries) GetNotStartedItems(ctx context.Context, arg GetNotStartedItems
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -4749,7 +4765,7 @@ func (q *Queries) GetReadingSpeed(ctx context.Context, arg GetReadingSpeedParams
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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.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.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.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
|
|
|
|
|
WHERE mi.library_id = $1
|
|
|
|
|
ORDER BY mi.created_at DESC
|
|
|
|
|
LIMIT $2
|
|
|
|
@@ -4823,6 +4839,7 @@ func (q *Queries) GetRecentlyAddedItems(ctx context.Context, arg GetRecentlyAdde
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -4841,7 +4858,7 @@ func (q *Queries) GetRecentlyAddedItems(ctx context.Context, arg GetRecentlyAdde
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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.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.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.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
|
|
|
|
|
INNER JOIN (
|
|
|
|
|
SELECT DISTINCT ON (media_item_id) media_item_id, last_read_at
|
|
|
|
|
FROM reading_progress
|
|
|
|
@@ -4923,6 +4940,7 @@ func (q *Queries) GetRecentlyReadItems(ctx context.Context, arg GetRecentlyReadI
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -6371,7 +6389,7 @@ func (q *Queries) ListLibraries(ctx context.Context) ([]ListLibrariesRow, error)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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.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.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.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
|
|
|
|
|
FROM media_items mi
|
|
|
|
|
JOIN libraries l ON mi.library_id = l.id
|
|
|
|
|
JOIN library_types lt ON l.library_type_id = lt.id
|
|
|
|
@@ -6437,6 +6455,7 @@ type ListMediaItemsRow struct {
|
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
|
ChapterMetadata []byte `db:"chapter_metadata" json:"chapter_metadata"`
|
|
|
|
|
LibraryTypeName pgtype.Text `db:"library_type_name" json:"library_type_name"`
|
|
|
|
|
TagsSearch []string `db:"tags_search" json:"tags_search"`
|
|
|
|
|
ContributorsSearch []string `db:"contributors_search" json:"contributors_search"`
|
|
|
|
|
FileSha256 pgtype.Text `db:"file_sha256" json:"file_sha256"`
|
|
|
|
@@ -6444,7 +6463,7 @@ type ListMediaItemsRow struct {
|
|
|
|
|
OpfUuid pgtype.Text `db:"opf_uuid" json:"opf_uuid"`
|
|
|
|
|
HashConfidence pgtype.Text `db:"hash_confidence" json:"hash_confidence"`
|
|
|
|
|
LibraryName string `db:"library_name" json:"library_name"`
|
|
|
|
|
LibraryTypeName string `db:"library_type_name" json:"library_type_name"`
|
|
|
|
|
LibraryTypeName_2 string `db:"library_type_name_2" json:"library_type_name_2"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (q *Queries) ListMediaItems(ctx context.Context, arg ListMediaItemsParams) ([]ListMediaItemsRow, error) {
|
|
|
|
@@ -6510,6 +6529,7 @@ func (q *Queries) ListMediaItems(ctx context.Context, arg ListMediaItemsParams)
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -6517,7 +6537,7 @@ func (q *Queries) ListMediaItems(ctx context.Context, arg ListMediaItemsParams)
|
|
|
|
|
&i.OpfUuid,
|
|
|
|
|
&i.HashConfidence,
|
|
|
|
|
&i.LibraryName,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.LibraryTypeName_2,
|
|
|
|
|
); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
@@ -6530,7 +6550,7 @@ func (q *Queries) ListMediaItems(ctx context.Context, arg ListMediaItemsParams)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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.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.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.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
|
|
|
|
|
FROM media_items mi
|
|
|
|
|
JOIN libraries l ON mi.library_id = l.id
|
|
|
|
|
JOIN library_types lt ON l.library_type_id = lt.id
|
|
|
|
@@ -6592,6 +6612,7 @@ type ListMediaItemsByLibraryRow struct {
|
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
|
ChapterMetadata []byte `db:"chapter_metadata" json:"chapter_metadata"`
|
|
|
|
|
LibraryTypeName pgtype.Text `db:"library_type_name" json:"library_type_name"`
|
|
|
|
|
TagsSearch []string `db:"tags_search" json:"tags_search"`
|
|
|
|
|
ContributorsSearch []string `db:"contributors_search" json:"contributors_search"`
|
|
|
|
|
FileSha256 pgtype.Text `db:"file_sha256" json:"file_sha256"`
|
|
|
|
@@ -6599,7 +6620,7 @@ type ListMediaItemsByLibraryRow struct {
|
|
|
|
|
OpfUuid pgtype.Text `db:"opf_uuid" json:"opf_uuid"`
|
|
|
|
|
HashConfidence pgtype.Text `db:"hash_confidence" json:"hash_confidence"`
|
|
|
|
|
LibraryName string `db:"library_name" json:"library_name"`
|
|
|
|
|
LibraryTypeName string `db:"library_type_name" json:"library_type_name"`
|
|
|
|
|
LibraryTypeName_2 string `db:"library_type_name_2" json:"library_type_name_2"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (q *Queries) ListMediaItemsByLibrary(ctx context.Context, libraryID pgtype.UUID) ([]ListMediaItemsByLibraryRow, error) {
|
|
|
|
@@ -6665,6 +6686,7 @@ func (q *Queries) ListMediaItemsByLibrary(ctx context.Context, libraryID pgtype.
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -6672,7 +6694,7 @@ func (q *Queries) ListMediaItemsByLibrary(ctx context.Context, libraryID pgtype.
|
|
|
|
|
&i.OpfUuid,
|
|
|
|
|
&i.HashConfidence,
|
|
|
|
|
&i.LibraryName,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.LibraryTypeName_2,
|
|
|
|
|
); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
@@ -6685,7 +6707,7 @@ func (q *Queries) ListMediaItemsByLibrary(ctx context.Context, libraryID pgtype.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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.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.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.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
|
|
|
|
|
FROM media_items mi
|
|
|
|
|
JOIN libraries l ON mi.library_id = l.id
|
|
|
|
|
JOIN library_types lt ON l.library_type_id = lt.id
|
|
|
|
@@ -6820,6 +6842,7 @@ type ListMediaItemsSortedRow struct {
|
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
|
ChapterMetadata []byte `db:"chapter_metadata" json:"chapter_metadata"`
|
|
|
|
|
LibraryTypeName pgtype.Text `db:"library_type_name" json:"library_type_name"`
|
|
|
|
|
TagsSearch []string `db:"tags_search" json:"tags_search"`
|
|
|
|
|
ContributorsSearch []string `db:"contributors_search" json:"contributors_search"`
|
|
|
|
|
FileSha256 pgtype.Text `db:"file_sha256" json:"file_sha256"`
|
|
|
|
@@ -6827,7 +6850,7 @@ type ListMediaItemsSortedRow struct {
|
|
|
|
|
OpfUuid pgtype.Text `db:"opf_uuid" json:"opf_uuid"`
|
|
|
|
|
HashConfidence pgtype.Text `db:"hash_confidence" json:"hash_confidence"`
|
|
|
|
|
LibraryName string `db:"library_name" json:"library_name"`
|
|
|
|
|
LibraryTypeName string `db:"library_type_name" json:"library_type_name"`
|
|
|
|
|
LibraryTypeName_2 string `db:"library_type_name_2" json:"library_type_name_2"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (q *Queries) ListMediaItemsSorted(ctx context.Context, arg ListMediaItemsSortedParams) ([]ListMediaItemsSortedRow, error) {
|
|
|
|
@@ -6898,6 +6921,7 @@ func (q *Queries) ListMediaItemsSorted(ctx context.Context, arg ListMediaItemsSo
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -6905,7 +6929,7 @@ func (q *Queries) ListMediaItemsSorted(ctx context.Context, arg ListMediaItemsSo
|
|
|
|
|
&i.OpfUuid,
|
|
|
|
|
&i.HashConfidence,
|
|
|
|
|
&i.LibraryName,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.LibraryTypeName_2,
|
|
|
|
|
); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
@@ -7648,7 +7672,7 @@ func (q *Queries) SearchLanguageValues(ctx context.Context, arg SearchLanguageVa
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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.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.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.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
|
|
|
|
|
FROM media_items mi
|
|
|
|
|
JOIN libraries l ON mi.library_id = l.id
|
|
|
|
|
JOIN library_types lt ON l.library_type_id = lt.id
|
|
|
|
@@ -7736,6 +7760,7 @@ type SearchMediaItemsRow struct {
|
|
|
|
|
ScanInformation pgtype.Text `db:"scan_information" json:"scan_information"`
|
|
|
|
|
Summary pgtype.Text `db:"summary" json:"summary"`
|
|
|
|
|
ChapterMetadata []byte `db:"chapter_metadata" json:"chapter_metadata"`
|
|
|
|
|
LibraryTypeName pgtype.Text `db:"library_type_name" json:"library_type_name"`
|
|
|
|
|
TagsSearch []string `db:"tags_search" json:"tags_search"`
|
|
|
|
|
ContributorsSearch []string `db:"contributors_search" json:"contributors_search"`
|
|
|
|
|
FileSha256 pgtype.Text `db:"file_sha256" json:"file_sha256"`
|
|
|
|
@@ -7743,7 +7768,7 @@ type SearchMediaItemsRow struct {
|
|
|
|
|
OpfUuid pgtype.Text `db:"opf_uuid" json:"opf_uuid"`
|
|
|
|
|
HashConfidence pgtype.Text `db:"hash_confidence" json:"hash_confidence"`
|
|
|
|
|
LibraryName string `db:"library_name" json:"library_name"`
|
|
|
|
|
LibraryTypeName string `db:"library_type_name" json:"library_type_name"`
|
|
|
|
|
LibraryTypeName_2 string `db:"library_type_name_2" json:"library_type_name_2"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Search Media Items queries
|
|
|
|
@@ -7816,6 +7841,7 @@ func (q *Queries) SearchMediaItems(ctx context.Context, arg SearchMediaItemsPara
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -7823,7 +7849,7 @@ func (q *Queries) SearchMediaItems(ctx context.Context, arg SearchMediaItemsPara
|
|
|
|
|
&i.OpfUuid,
|
|
|
|
|
&i.HashConfidence,
|
|
|
|
|
&i.LibraryName,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.LibraryTypeName_2,
|
|
|
|
|
); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
@@ -8979,7 +9005,7 @@ UPDATE media_items SET
|
|
|
|
|
google_books_id = $23,
|
|
|
|
|
updated_at = NOW()
|
|
|
|
|
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, 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, 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, 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
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
type UpdateMediaItemParams struct {
|
|
|
|
@@ -9089,6 +9115,87 @@ func (q *Queries) UpdateMediaItem(ctx context.Context, arg UpdateMediaItemParams
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
|
&i.OpfIdentifier,
|
|
|
|
|
&i.OpfUuid,
|
|
|
|
|
&i.HashConfidence,
|
|
|
|
|
)
|
|
|
|
|
return i, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const UpdateMediaItemChapterMetadata = `-- name: UpdateMediaItemChapterMetadata :one
|
|
|
|
|
UPDATE media_items
|
|
|
|
|
SET chapter_metadata = $2, updated_at = NOW()
|
|
|
|
|
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, 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
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
type UpdateMediaItemChapterMetadataParams struct {
|
|
|
|
|
ID pgtype.UUID `db:"id" json:"id"`
|
|
|
|
|
ChapterMetadata []byte `db:"chapter_metadata" json:"chapter_metadata"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (q *Queries) UpdateMediaItemChapterMetadata(ctx context.Context, arg UpdateMediaItemChapterMetadataParams) (MediaItems, error) {
|
|
|
|
|
row := q.db.QueryRow(ctx, UpdateMediaItemChapterMetadata, arg.ID, arg.ChapterMetadata)
|
|
|
|
|
var i MediaItems
|
|
|
|
|
err := row.Scan(
|
|
|
|
|
&i.ID,
|
|
|
|
|
&i.LibraryID,
|
|
|
|
|
&i.Title,
|
|
|
|
|
&i.Author,
|
|
|
|
|
&i.Isbn,
|
|
|
|
|
&i.Description,
|
|
|
|
|
&i.FilePath,
|
|
|
|
|
&i.FileSize,
|
|
|
|
|
&i.MimeType,
|
|
|
|
|
&i.CoverImagePath,
|
|
|
|
|
&i.Series,
|
|
|
|
|
&i.SeriesNumber,
|
|
|
|
|
&i.Tags,
|
|
|
|
|
&i.Asin,
|
|
|
|
|
&i.DatePublished,
|
|
|
|
|
&i.Publisher,
|
|
|
|
|
&i.Contributors,
|
|
|
|
|
&i.Language,
|
|
|
|
|
&i.Edition,
|
|
|
|
|
&i.PageCount,
|
|
|
|
|
&i.Genre,
|
|
|
|
|
&i.CopyrightYear,
|
|
|
|
|
&i.GoodreadsID,
|
|
|
|
|
&i.OpenlibraryID,
|
|
|
|
|
&i.GoogleBooksID,
|
|
|
|
|
&i.AddedByAdminID,
|
|
|
|
|
&i.CreatedAt,
|
|
|
|
|
&i.UpdatedAt,
|
|
|
|
|
&i.FormatGroup,
|
|
|
|
|
&i.FormatMimetype,
|
|
|
|
|
&i.IsReflowable,
|
|
|
|
|
&i.HasFixedLayout,
|
|
|
|
|
&i.TotalCharacters,
|
|
|
|
|
&i.ChapterCount,
|
|
|
|
|
&i.EntitlementID,
|
|
|
|
|
&i.RevisionNumber,
|
|
|
|
|
&i.KoboContentID,
|
|
|
|
|
&i.KoboMetadata,
|
|
|
|
|
&i.MangaType,
|
|
|
|
|
&i.ReadingDirection,
|
|
|
|
|
&i.SeriesCount,
|
|
|
|
|
&i.Volume,
|
|
|
|
|
&i.Imprint,
|
|
|
|
|
&i.AgeRating,
|
|
|
|
|
&i.WebUrl,
|
|
|
|
|
&i.StoryArc,
|
|
|
|
|
&i.IsBlackAndWhite,
|
|
|
|
|
&i.MetadataNotes,
|
|
|
|
|
&i.CommunityRating,
|
|
|
|
|
&i.AlternateInfo,
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -9194,7 +9301,7 @@ SET
|
|
|
|
|
hash_confidence = $5,
|
|
|
|
|
updated_at = NOW()
|
|
|
|
|
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, 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, 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, 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
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
type UpdateMediaItemIdentifiersParams struct {
|
|
|
|
@@ -9273,6 +9380,7 @@ func (q *Queries) UpdateMediaItemIdentifiers(ctx context.Context, arg UpdateMedi
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
@@ -9291,7 +9399,7 @@ SET entitlement_id = $2,
|
|
|
|
|
kobo_metadata = $5,
|
|
|
|
|
updated_at = NOW()
|
|
|
|
|
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, 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, 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, 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
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
type UpdateMediaItemKoboMetadataParams struct {
|
|
|
|
@@ -9365,6 +9473,7 @@ func (q *Queries) UpdateMediaItemKoboMetadata(ctx context.Context, arg UpdateMed
|
|
|
|
|
&i.ScanInformation,
|
|
|
|
|
&i.Summary,
|
|
|
|
|
&i.ChapterMetadata,
|
|
|
|
|
&i.LibraryTypeName,
|
|
|
|
|
&i.TagsSearch,
|
|
|
|
|
&i.ContributorsSearch,
|
|
|
|
|
&i.FileSha256,
|
|
|
|
|