[Rhythmbox-devel] Help with get one number limited of songs



I get all songs with:

for row in self.shell.props.library_source.props.base_query_model:
    print(row[0].get_string(RB.RhythmDBPropType.TITLE))

I need get only 10 songs (for example). I test with:

self.shell.props.library_source.props.base_query_model.set_property("limit-value", GLib.Variant("n", 10))
for row in self.shell.props.library_source.props.base_query_model:
    print(row[0].get_string(RB.RhythmDBPropType.TITLE))

But show error:

Warning: g_object_set_property: construct property "limit-value" for object 'RhythmDBQueryModel' can't be set after construction
  self.shell.props.library_source.props.base_query_model.set_property("limit-value", GLib.Var

Thank you for any help!


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]