View Single Post
Old 10-21-2023, 12:21 PM   #34
Pr.BarnArt
Addict
Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.
 
Pr.BarnArt's Avatar
 
Posts: 397
Karma: 401800
Join Date: Jun 2011
Device: Pocketbook 902 / Ipad air/ kindle paperwhite
Quote:
Originally Posted by anoukaimee View Post
I'm wondering the same--how to combine the ratings with those in my ratings column?

Sorry, I missed the previous posts, but I like the question.
being not an expert in sqlite, i will give it a try for windows.
  1. First of all you have to download sqlite3 from the official SQLite website

  2. Download the file (sqlite-tools-win32-x86-3270200.zip) as shown in the figure below and extract these files in a folder of your choice.

  3. Copy sqlite3.exe to the directory of your calibre library.
    In my case it is: e:\ebooks

  4. In that directory make a copy of the metadata.db
    (for safety reason, in case of errors you can rename the copy back to metadata.db)
  5. Now open a command window: cmd (in search/windows key)

  6. Navigate to the library directory (step 3)
    in my case
    e: +return(for the drive)
    cd ebooks +return ( for the directory)

  7. The command prompt now shows the drive and directory

  8. In the command window type:
    sqlite3 metadata.db + return

  9. he prompt changes to sqlite.
    We have to find the custom column for gr_ratings.
    type:
    select * from custom_columns; +return (don't forget the ; at the end of the command)



  10. The results ( see image) shows that gr_ratings is number 42. The first number in the row with gr_rating.
    The number for you will be different.
  11. I presume you have already made the custom columns for the orginal goodreads plugin: grrating en grvotes.

  12. We only will copy the rating info for books, that have no rating from the orginal goodreads-plugin.
    Edit the following lines of code: replace custom_column_42 with custom_column_NR (the number of your column in step 10)

    Code:
    INSERT INTO identifiers (book, type,val)
    SELECT c.book,'grrating', c.value
    FROM custom_column_42 AS c
    WHERE NOT EXISTS (SELECT 1
                      FROM identifiers AS Ident
                      WHERE Ident.book = c.book and Ident.type='grrating');
  13. Copy and paste the edited code in the command window + return;

  14. If all is OK, you can close the command window;

  15. When you start calibre, You wil see that the rating of the goodreads-rating plugin is added to the identifiers of the book and is shown in the grrating column.
  16. If the database is broken, you can rename the copy of the databse back to metadata.db

Last edited by Pr.BarnArt; 10-22-2023 at 11:26 AM.
Pr.BarnArt is offline   Reply With Quote