# CVIssueCount A ComicRack Community Edition plugin that fetches issue counts from ComicVine and updates your comic library. ## Features - Fetches issue count for comic volumes from ComicVine API - **Local database support**: Use a local SQLite database (`localcv.db`) for faster lookups without API calls - **Configurable settings**: API key, delay between requests, and data source preferences - Updates both the `Count` field and a custom `comicvine_issue_count` field - Progress bar with cancel support ## Installation 1. Download the latest release from the [Releases](../../releases) tab 2. Extract the contents to your ComicRack scripts folder: ``` %APPDATA%\cYo\ComicRack Community Edition\Scripts\CVIssueCount\ ``` 3. Restart ComicRack ### Required Files ``` CVIssueCount/ ├── CVIssueCount.py ├── CVIssueCount.png ├── System.Data.SQLite.dll (required for local DB) ├── x64/ │ └── e_sqlite3.dll (required for local DB on 64-bit) ├── x86/ │ └── e_sqlite3.dll (required for local DB on 32-bit) └── localcv.db (optional - local ComicVine database) ``` ### Setting up SQLite for Local Database To use the local database feature, you need the SQLite libraries: 1. **System.Data.SQLite.dll** - Download from [NuGet - System.Data.SQLite](https://www.nuget.org/api/v2/package/System.Data.SQLite/) - Extract the `.nupkg` file (it's a zip file) - Copy `lib/net471/System.Data.SQLite.dll` to the plugin folder 2. **e_sqlite3.dll (native library)** - Download from [NuGet - SourceGear.sqlite3](https://www.nuget.org/api/v2/package/SourceGear.sqlite3/) - Extract the `.nupkg` file - Create `x64` and `x86` folders in the plugin directory - Copy `runtimes/win-x64/native/e_sqlite3.dll` → `x64/e_sqlite3.dll` - Copy `runtimes/win-x86/native/e_sqlite3.dll` → `x86/e_sqlite3.dll` ### Getting the Local Database The `localcv.db` file contains an offline copy of ComicVine volume data. Download it from: **[Offline ComicVine Database on Reddit](https://old.reddit.com/r/comicrackusers/comments/1q7rex8/here_it_is_an_offline_comicvine_tagger_for/)** Place `localcv.db` in the plugin folder after downloading. ## Usage ### Running the Plugin 1. Select one or more comics in your library 2. Right-click -> Automation -> CVIssueCount - or click the icon in the menu bar 3. Click Start to begin fetching issue counts ### Settings Access settings via: - Settings button in the main dialog #### Available Settings | Setting | Description | |---------|-------------| | **ComicVine API Key** | Your ComicVine API key (get one at [comicvine.gamespot.com/api](https://comicvine.gamespot.com/api/)) | | **Skip API if not in local DB** | Only use the local database; skip volumes not found locally | | **Always use API** | Ignore local database and always fetch from ComicVine API | | **API delay (seconds)** | Delay between API requests (default: 10). Set to 0 to disable | ## Local Database For faster lookups without API rate limits, you can use a local SQLite database containing ComicVine volume data. The database should be named `localcv.db` and placed in the plugin folder. It must have a `cv_volume` table with at least these columns: - `id` - ComicVine volume ID - `count_of_issues` - Number of issues in the volume ### Data Source Priority 1. If local database exists and "Always use API" is unchecked → check local DB first 2. If not found in local DB and "Skip API" is unchecked → fall back to API 3. If "Always use API" is checked → skip local DB entirely ## Requirements - ComicRack Community Edition - Comics must have `comicvine_volume` custom field populated (e.g., via ComicVine Scraper) - For API usage: Valid ComicVine API key - For local DB: SQLite DLLs included in the release ## Troubleshooting ### "System.Data.SQLite.dll not found" Make sure `System.Data.SQLite.dll` is in the plugin folder. ### "Unable to load DLL 'e_sqlite3'" Ensure the `x64` and `x86` folders contain `e_sqlite3.dll`. ### API rate limiting ComicVine has API rate limits. Increase the API delay in settings if you're getting errors.