Ticket #338 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

New 'hide_empty_assets' parameter on /collection call

Reported by: Frans Owned by: robert
Priority: major Milestone: MediaMosa 2.2
Component: Core Version:
Keywords: Cc:
MoSCoW: Should Have Estimated time after impact analysis:
Related to project: none Tested: yes
Accepted: yes Estimated Hours: 0

Description

Currently there is nu such parameter on the /collection call. Only on assets. Meaning that the /collection call will also return empty (no mediafiles) assets.

Setting this parameter to true will suppress this.

Change History

Changed 3 years ago by MC-arjen

  • milestone changed from MediaMosa X.X to MediaMosa 2.2

Changed 3 years ago by MC-arjen

  • owner set to robert
  • status changed from new to assigned

Changed 3 years ago by robert

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

Done -> release 2.2.1 build 861+

Changed 3 years ago by Michiel.Schok

  • status changed from closed to reopened
  • tested changed from no to yes
  • resolution fixed deleted

I'm not sure if it works.

Have uploaded an empty asset to VP-Core acceptatie.
asset_id = w24ijNDMHfaILbHdails6PBq

I've added this asset to collection with id=aUNpWKawVeKXdVVEXsZudWkV
This is the only asset in this collection.

When I perform the following queries, I *always* get <numofvideos>1</numofvideos>, and I expect them to return 0 when 'hide_empty_assets=true' is added as a parameter.

<request_uri>[GET] collection?owner_id=SURFNET.michiel&amp;title=trac</request_uri>

    <item id="1">
      <coll_id>aUNpWKawVeKXdVVEXsZudWkV</coll_id>
      <title>Trac 338</title>
      ...
      <numofvideos>1</numofvideos>
    </item>
<request_uri>[GET] collection?owner_id=SURFNET.michiel&amp;title=trac&amp;hide_empty_assets=true</request_uri>

    <item id="1">
      <coll_id>aUNpWKawVeKXdVVEXsZudWkV</coll_id>
      <title>Trac 338</title>
      ...
      <numofvideos>1</numofvideos>
    </item>

Probably, this is implemented in the /collection/{id}/assets call (which is also very good, but not what I intended when asking Frans...).

Changed 3 years ago by robert

Ok, my mistake. I wrote unit test to test the new code, the test counts the videos that are returned, but the code only returns the assets that ARE empty. The unit test passed because I only add 2 videos in the unittest. Checking for count 1 is always true because one is always empty the other one not. In both cases the result would have been 1 (1 empty, 1 not).

I changed the unit test to get the expected test case (2 empty, 1 not), and now fixed the code to pass the unit test again.

fixed in -> v2.2.2 (build 898+)

Changed 3 years ago by robert

Ow btw, the new code also /collection REST call/

Changed 3 years ago by robert

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

Changed 3 years ago by Michiel.Schok

  • accepted changed from no to yes

ack

Note: See TracTickets for help on using tickets.