Bug 245647

Summary: programmatic access to data objects in qtscript
Product: [Applications] amarok Reporter: Manuel Amador (Rudd-O) <rudd-o>
Component: Tools/Script ManagerAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: 2.3.1-GIT   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Manuel Amador (Rudd-O) 2010-07-24 15:44:10 UTC
Version:           2.3.1-GIT
OS:                Linux

I would like, as a programmer of Amarok scripts, to be able to call a function and specify queries using the textual format like the user can do to specify queries in the collection browser.  I would like the returned data to be a list of objects.  And I would like to be able to call setX (X = artist, album, basically all the Meta:: information) and have Amarok save that information to the file / to the database (in the case of e.g. labels or ratings or whatnot).  Essentially, I want programmatic access to the C++ objects that the collection managers manipulate.

This, I believe, would massively simplify programming of very, very useful scripts.  It would also enable scripts that interact with the collection in meaningful ways, AND refresh the current views when something is changed (ATM if you change a file from "outside amarok" -- out-of-process -- you have to request a collection update, which is VERY expensive when you have a large collection).

Reproducible: Didn't try
Comment 1 Anmol Ahuja 2014-02-26 17:15:15 UTC
Git commit d74d1813af9cd58996a3e2595b9fe11022300a88 by Anmol Ahuja.
Committed on 28/06/2013 at 14:32.
Pushed by anmolahuja into branch 'master'.

Scripting access to QueryMakers.

M  +2    -1    src/CMakeLists.txt
M  +3    -1    src/ScriptManager.cpp
M  +6    -5    src/scriptengine/exporters/CollectionTypeExporter.h
A  +107  -0    src/scriptengine/exporters/QueryMakerExporter.cpp     [License: GPL (v2+)]
A  +105  -0    src/scriptengine/exporters/QueryMakerExporter.h     [License: GPL (v2+)]

http://commits.kde.org/amarok/d74d1813af9cd58996a3e2595b9fe11022300a88