10-19-2015, 11:52 PM
How do you reset the play count in nightingale 1.12.1 ?
reset Play count
|
10-19-2015, 11:52 PM
How do you reset the play count in nightingale 1.12.1 ?
10-21-2015, 12:18 AM
I'm not aware of a direct way to do so in the graphical user interface.
Thus, you can either write an add-on wiping the play count (have a look at RatingFile's source code, it uses the same APIs), use RatingFile to back your ratings and play/skip counts up, then edit the resulting file (it is a regular text file, any editor with a search-replace feature should work), and import it again, or directly modify the sqlite database located in your profile's 'db' folder. Did that already help you? If not, what OS are you on (windows / linux / mac)?
Songbird/Nightingale Community Developer and German Translator
10-21-2015, 05:40 PM
(10-21-2015, 12:18 AM)rsjtdrjgfuzkfg Wrote: I'm not aware of a direct way to do so in the graphical user interface. Hi I am on Linux I had a quick look at the db with sql lite but I could not see the field for play counts and the db did not seem to contain enough entries for the amount of files I have do you know the details of the db ? cheers
10-22-2015, 12:46 AM
(This post was last modified: 10-22-2015, 12:51 AM by rsjtdrjgfuzkfg.)
Warning: Long answer. Read till the end (or only the end for that matter) to get a reasonable solution to reset play counts.
(10-21-2015, 05:40 PM)tonyd Wrote: I had a quick look at the db with sql lite but I could not see the field for play counts and the db did not seem to contain enough entries for the amount of files I have First of all, did you open the database of your main library? You are most likely interested in ~/.nightingale/XXXXXXXX.default/db/main@library.songbirdnest.com.db To get the play counts, first determine the property_id of play counts in your database (through the table properties), then update the play counts themselves in the resource_properties table. In theory, the following should work: Code: UPDATE resource_properties SET obj = '0', obj_searchable = '+0000000000000000000', obj_sortable = '+0000000000000000000' WHERE property_id = (SELECT property_id FROM properties WHERE property_name = 'http://songbirdnest.com/data/1.0#playCount'); It would, in theory, be possible to build only the collation type into a library and load it via ".load", but the collation type is dependent on the whole localization code (as it is dependent on Nightingale's current locale, see components/dbengine/src/DatabaseEngine.cpp), and must not be changed without issuing a migration step, so using a quick and dirty fixed-locale collation might break indices for libraries not created in that locale. I think it would be possible to force collation migration to simple c-style comparasions when switching localeCollationEnabled on the DatabaseEngine to false, however I have not verified that, so don't blindly assume that works (and you'd still need to build a collation library for the sqlite cli). You can, however execute SQL directly through Nightingale. To reset play counts, back your profile up (as you should when messing with the internals of your library), and execute the following in the error console (tools menu, copy-paste in the small text field and hit evaluate) After "Done. Remember to immediately restart Nightingale" is printed, restart Nightingale without doing anything else, as caches might be outdated. After you restarted, your play counts are all resetted: Code: var dbq = Components.classes["@songbirdnest.com/Songbird/DatabaseQuery;1"].createInstance(Components.interfaces.sbIDatabaseQuery); So much about the database, but read on for a better alternative I have not thought of before: instead of writing an add-on properly resetting the play counts, you can also do so through the error console: main advantage is that you do not run into caching issues, and this works independently of the structure of the database: Code: Components.utils.import("resource://app/jsmodules/sbProperties.jsm");
Songbird/Nightingale Community Developer and German Translator
|
« Next Oldest | Next Newest »
|