|
| 1 | +package kobo |
| 2 | + |
| 3 | +type Content struct { |
| 4 | + ContentID string `db:"ContentID"` |
| 5 | + ContentType string `db:"ContentType"` |
| 6 | + MimeType string `db:"MimeType"` |
| 7 | + BookID string `db:"BookID"` |
| 8 | + BookTitle string `db:"BookTitle"` |
| 9 | + ImageId string `db:"ImageId"` |
| 10 | + Title string `db:"Title"` |
| 11 | + Attribution string `db:"Attribution"` |
| 12 | + Description string `db:"Description"` |
| 13 | + DateCreated string `db:"DateCreated"` |
| 14 | + ShortCoverKey string `db:"ShortCoverKey"` |
| 15 | + AdobeLocation string `db:"adobe_location"` |
| 16 | + Publisher string `db:"Publisher"` |
| 17 | + IsEncrypted bool `db:"IsEncrypted"` |
| 18 | + DateLastRead string `db:"DateLastRead"` |
| 19 | + FirstTimeReading bool `db:"FirstTimeReading"` |
| 20 | + ChapterIDBookmarked string `db:"ChapterIDBookmarked"` |
| 21 | + ParagraphBookmarked int `db:"ParagraphBookmarked"` |
| 22 | + BookmarkWordOffset int `db:"BookmarkWordOffset"` |
| 23 | + NumShortcovers int `db:"NumShortcovers"` |
| 24 | + VolumeIndex int `db:"VolumeIndex"` |
| 25 | + NumPages int `db:"___NumPages"` |
| 26 | + ReadStatus int `db:"ReadStatus"` |
| 27 | + SyncTime string `db:"___SyncTime"` |
| 28 | + UserID string `db:"___UserID"` |
| 29 | + PublicationId string `db:"PublicationId"` |
| 30 | + FileOffset int `db:"___FileOffset"` |
| 31 | + FileSize int `db:"___FileSize"` |
| 32 | + PercentRead int `db:"___PercentRead"` |
| 33 | + ExpirationStatus int `db:"___ExpirationStatus"` |
| 34 | + FavouritesIndex int `db:"FavouritesIndex"` |
| 35 | + Accessibility int `db:"Accessibility"` |
| 36 | + ContentURL string `db:"ContentURL"` |
| 37 | + Language string `db:"Language"` |
| 38 | + BookshelfTags string `db:"BookshelfTags"` |
| 39 | + IsDownloaded bool `db:"IsDownloaded"` |
| 40 | + FeedbackType int `db:"FeedbackType"` |
| 41 | + AverageRating int `db:"AverageRating"` |
| 42 | + Depth int `db:"Depth"` |
| 43 | + PageProgressDirection string `db:"PageProgressDirection"` |
| 44 | + InWishlist bool `db:"InWishlist"` |
| 45 | + ISBN string `db:"ISBN"` |
| 46 | + WishlistedDate string `db:"WishlistedDate"` |
| 47 | + FeedbackTypeSynced int `db:"FeedbackTypeSynced"` |
| 48 | + IsSocialEnabled bool `db:"IsSocialEnabled"` |
| 49 | + EpubType int `db:"EpubType"` |
| 50 | + Monetization int `db:"Monetization"` |
| 51 | + ExternalId string `db:"ExternalId"` |
| 52 | + Series string `db:"Series"` |
| 53 | + SeriesNumber string `db:"SeriesNumber"` |
| 54 | + Subtitle string `db:"Subtitle"` |
| 55 | + WordCount int `db:"WordCount"` |
| 56 | + Fallback string `db:"Fallback"` |
| 57 | + RestOfBookEstimate int `db:"RestOfBookEstimate"` |
| 58 | + CurrentChapterEstimate int `db:"CurrentChapterEstimate"` |
| 59 | + CurrentChapterProgress float32 `db:"CurrentChapterProgress"` |
| 60 | + PocketStatus int `db:"PocketStatus"` |
| 61 | + UnsyncedPocketChanges string `db:"UnsyncedPocketChanges"` |
| 62 | + ImageUrl string `db:"ImageUrl"` |
| 63 | + DateAdded string `db:"DateAdded"` |
| 64 | + WorkId string `db:"WorkId"` |
| 65 | + Properties string `db:"Properties"` |
| 66 | + RenditionSpread string `db:"RenditionSpread"` |
| 67 | + RatingCount int `db:"RatingCount"` |
| 68 | + ReviewsSyncDate string `db:"ReviewsSyncDate"` |
| 69 | + MediaOverlay string `db:"MediaOverlay"` |
| 70 | + MediaOverlayType string `db:"MediaOverlayType"` |
| 71 | + RedirectPreviewUrl bool `db:"RedirectPreviewUrl"` |
| 72 | + PreviewFileSize int `db:"PreviewFileSize"` |
| 73 | + EntitlementId string `db:"EntitlementId"` |
| 74 | + CrossRevisionId string `db:"CrossRevisionId"` |
| 75 | + DownloadUrl string `db:"DownloadUrl"` |
| 76 | + ReadStateSynced bool `db:"ReadStateSynced"` |
| 77 | + TimesStartedReading int `db:"TimesStartedReading"` |
| 78 | + TimeSpentReading int `db:"TimeSpentReading"` |
| 79 | + LastTimeStartedReading string `db:"LastTimeStartedReading"` |
| 80 | + LastTimeFinishedReading string `db:"LastTimeFinishedReading"` |
| 81 | + ApplicableSubscriptions string `db:"ApplicableSubscriptions"` |
| 82 | + ExternalIds string `db:"ExternalIds"` |
| 83 | + PurchaseRevisionId string `db:"PurchaseRevisionId"` |
| 84 | + SeriesID string `db:"SeriesID"` |
| 85 | + SeriesNumberFloat float64 `db:"SeriesNumberFloat"` |
| 86 | + AdobeLoanExpiration string `db:"AdobeLoanExpiration"` |
| 87 | + HideFromHomePage bool `db:"HideFromHomePage"` |
| 88 | + IsInternetArchive bool `db:"IsInternetArchive"` |
| 89 | + TitleKana string `db:"titleKana"` |
| 90 | + SubtitleKana string `db:"subtitleKana"` |
| 91 | + SeriesKana string `db:"seriesKana"` |
| 92 | + AttributionKana string `db:"attributionKana"` |
| 93 | + PublisherKana string `db:"publisherKana"` |
| 94 | + IsPurchaseable bool `db:"IsPurchaseable"` |
| 95 | + IsSupported bool `db:"IsSupported"` |
| 96 | + AnnotationsSyncToken string `db:"AnnotationsSyncToken"` |
| 97 | + DateModified string `db:"DateModified"` |
| 98 | + StorePages int `db:"StorePages"` |
| 99 | + StoreWordCount int `db:"StoreWordCount"` |
| 100 | + StoreTimeToReadLowerEstimate int `db:"StoreTimeToReadLowerEstimate"` |
| 101 | + StoreTimeToReadUpperEstimate int `db:"StoreTimeToReadUpperEstimate"` |
| 102 | + Duration int `db:"Duration"` |
| 103 | + IsAbridged bool `db:"IsAbridged"` |
| 104 | +} |
| 105 | + |
| 106 | +func CountContent(kobo *Kobo) (count int, err error) { |
| 107 | + if err := kobo.dbClient.Get( |
| 108 | + &count, |
| 109 | + "SELECT count(*) FROM content WHERE ContentType = ? AND VolumeIndex = ? AND MimeType = ?", |
| 110 | + 6, -1, "application/x-kobo-epub+zip", |
| 111 | + ); err != nil { |
| 112 | + return count, err |
| 113 | + } |
| 114 | + return count, nil |
| 115 | +} |
0 commit comments