@mes wrote:
Hi all,
I'm trying to update field "plays" of a media Entry but while the code runs without any problems/exceptions the value of the entry stays the same.
The code i'm using is below :
try { String ks = client.getSessionService().start(ADMIN_SECRET, getUserId(), KalturaSessionType.ADMIN, PARTNER_ID, 86400, "disableentitlement"); client.setKs(ks); client.setSessionId(ks); // Get Media Entry KalturaMediaEntry getMediaEntry = client.getMediaService().get(entry_id); // Get plays of Media Entry int plays = getMediaEntry.plays; int updatedPlays = plays + 1; // Create updated Media Entry with plays+1 KalturaMediaEntry updatedMediaEntry = new KalturaMediaEntry(); updatedMediaEntry.plays = updatedPlays; // Update client.getMediaService().update(entry_id, updatedMediaEntry); } catch (KalturaApiException e) { e.printStackTrace(); Log.i(TAG, "Update Num of plays error: " + e.getMessage() ); }
Posts: 1
Participants: 1