Ticket #157 (closed defect: fixed)

Opened 11 months ago

Last modified 10 months ago

Total count is incorrect in /collection/{coll_id}/asset and /asset [get]

Reported by: marc_ibuildings Owned by:
Priority: major Milestone: MediaMosa 1.6
Component: REST Version: Tested and Accepted
Keywords: Cc:
MoSCoW: Estimated time after impact analysis:
Related to project: none Tested:
Accepted: yes Estimated Hours:

Description

Two requests:

<header>
<item_count>8</item_count>
<item_count_total>8</item_count_total>
<item_offset>0</item_offset>
<request_process_time>0.202</request_process_time>
<request_query_count>33</request_query_count>
<request_result>success</request_result>
<request_result_description/>
<request_result_id>601</request_result_id>
<request_uri>[GET] collection/GtvYdb4ITVwC1jTZzj67nVhs/asset?limit=200&amp;app_id=5</request_uri>
<vpx_version>1.6</vpx_version>
</header>

Which is correct.

<header>
<item_count>4</item_count>
<item_count_total>4</item_count_total>
<item_offset>0</item_offset>
<request_process_time>0.0566</request_process_time>
<request_query_count>25</request_query_count>
<request_result>success</request_result>
<request_result_description/>
<request_result_id>601</request_result_id>
<request_uri>[GET] collection/GtvYdb4ITVwC1jTZzj67nVhs/asset?limit=4&amp;app_id=5</request_uri>
<vpx_version>1.6</vpx_version>
</header>

Here item_count should be 4, and item_count_total should be 8,
not the limit.

Change History

Changed 10 months ago by MC-arjen

  • milestone changed from MediaMosa X.X to MediaMosa 1.7

Changed 10 months ago by marc_ibuildings

  • summary changed from Total count is incorrect in /collection/{coll_id}/asset to Total count is incorrect in /collection/{coll_id}/asset and /asset [get]

The same issue occurs in /asset [get]:

<header>
<item_count>1</item_count>
<item_count_total>1</item_count_total>
<item_offset>0</item_offset>
<request_process_time>0.029</request_process_time>
<request_query_count>26</request_query_count>
<request_result>success</request_result>
<request_result_description/>
<request_result_id>601</request_result_id>
<request_uri>[GET] asset?owner_id=SURFgroepen.smibuildings&amp;limit=1&amp;user_id=SURFgroepen.smibuildings&amp;hide_empty_assets=true&amp;app_id=5</request_uri>
<vpx_version>1.6</vpx_version>
</header>

Changed 10 months ago by Frans

Is it possible to fix this in the 1.6.1 release?
Seems to be rather important.

Changed 10 months ago by Frans

  • milestone changed from MediaMosa 1.7 to MediaMosa 1.6

Changed 10 months ago by MC-arjen

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

fixed in 1.6.1, this is due to the performance workaround for SUrfmedia; The total was not calculated when the limit < 7. This is changed to when the parameter limit=3 or limit=6, the totals are not calculated.

Of course this is a workaround until a better solution is realised (rest call caching, extra parameter for calculation total or not).

Changed 10 months ago by Michiel.Schok

  • accepted changed from no to yes

We now request a higher limit than 6 if we need the total count.

Is it a sound idea (please create a different ticket in 1.7 or later) to create restcalls or parameters to 'only' get totals, and not the rest of the details.

e.g. If I want the number of assets which have a title of 'foo', now we use

/asset?title=foo&limit=10 

which returns the 'item_count' we are interested in, but also return a lot of details of the assets, we are not interested in.
A call like

/asset/count?title=idioten

would be great. At the moment /count reports totals, but ignores the title parameter.

Accepted.

Changed 10 months ago by Frans

  • version set to Tested and Accepted
Note: See TracTickets for help on using tickets.