Ticket #204 (closed enhancement: fixed)

Opened 4 years ago

Last modified 3 years ago

Introduction /collection/{id}/count call

Reported by: Michiel.Schok Owned by: robert
Priority: major Milestone: MediaMosa 2.2
Component: Core Version:
Keywords: Cc:
MoSCoW: Must Have Estimated time after impact analysis:
Related to project: none Tested: yes
Accepted: yes Estimated Hours: 6

Description

Which returns the number of assets in the collection, without asset details.

Parameters supported:
hide_empty_assets, default false. When hide_empty_assets is true, only the non-empty assets are counted.

Background:
At the moment, the only way to gather information about the total number of assets in a collection is an
/collection/{id}/asset?limit=10 query, where the asset-detail results are ignored, and only the total count in the header is used. That query operation is resource intensive, while assets must be sorted, and the <granted> field must be calculated.
The /count call would be a very cheap alternative.

Change History

Changed 4 years ago by Michiel.Schok

An alternative approach is the extension of the current
/collection/{id} call, which has to provide the

<numofvideos>xyz</numofvideos> as part of the regular xml-response.

We observe that that number of assets is already part of the
/collection search query, so the number is known to the system and does not have to be calculated at runtime.

Changed 3 years ago by Frans

  • owner set to MC-Arjen
  • status changed from new to assigned

Changed 3 years ago by Frans

  • milestone changed from MediaMosa 1.7 to MediaMosa 2.1

Moved to MediaMosa 2.1

Changed 3 years ago by Frans

  • moscow set to Should Have

Changed 3 years ago by Frans

  • milestone changed from MediaMosa 2.1 to MediaMosa 2.2

Changed 3 years ago by Frans

  • moscow changed from Should Have to Must Have

Changed 3 years ago by robert

  • estimated_hours set to 6

Changed 3 years ago by forgacs

  • owner changed from MC-Arjen to forgacs

Changed 3 years ago by forgacs

  • owner changed from forgacs to robert

Ready. It is in my repository.

Changed 3 years ago by robert

  • status changed from assigned to closed
  • resolution set to fixed

Changed 3 years ago by Michiel.Schok

  • status changed from closed to reopened
  • resolution fixed deleted

It seems it's not implemented? Strange...

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <header>
    <item_count>0</item_count>
    <item_count_total>0</item_count_total>
    <item_offset>0</item_offset>
    <request_process_time>0.0154</request_process_time>
    <request_result>error</request_result>
    <request_result_description>Page not found: collection/6zHFpA9oKgEP2mlpC33trj9V/count (method: -, parameters: -)</request_result_description>
    <request_result_id>404</request_result_id>
    <request_uri>[GET] collection/6zHFpA9oKgEP2mlpC33trj9V/count</request_uri>
    <version>2.2.1.894</version>
  </header>
  <items/>
</response>

Changed 3 years ago by robert

  • status changed from reopened to closed
  • resolution set to fixed

We decided not to use

/collection/$coll_id/count,

be instead we made

/collection/$coll_id/asset/count.

However, 2.2.1 version will only give back the number of videos inside the collection, not matter the is_empty_asset value. The 2.2.2 version has the is_empty_asset parameter, put that on TRUE and it will return the asset count that are not empty.

Also the call /collection/$coll_id has been extended with the is_empty_asset parameter.

Fixed -> 2.2.2 Build 919.

Changed 3 years ago by Michiel.Schok

Hopefully the parameter is called 'hide_empty_assets'...

Changed 3 years ago by robert

Parameter is called 'hide_empty_assets', was my typo in the text.

(The name 'is_empty_asset' is used in database as field name).

Changed 3 years ago by Michiel.Schok

  • tested set to yes

It is implemented as requested.

Documentation on  http://beheer.vpcore.snkn.nl/admin/mediamosa/browse/restcall/collection-%24coll_id-asset-count/GET is allright, but the documentation at http://mediamosa.org/api is missing.

I won't accept the issue, but someone else may do this if missing documentation is not an issue for them.

Changed 3 years ago by Frans

  • accepted changed from no to yes

API documentation is not missing anymore:
http://mediamosa.org/node/218135

Note: See TracTickets for help on using tickets.