﻿///<reference path="CliPropConfig6.js" />

function CliPspLibraryCache(propositionInstance)
{
    this.proposition = propositionInstance;
    this._base = new CliLibraryCache(propositionInstance);
    this._cache = propositionInstance.LibraryCache;
}

CliPspLibraryCache.prototype =
{
    
    AddToCache: function(mediaContentId, statusKey, price, purchaseStatus, syncsRemaining)
    {
        ///<summary>Adds an item to the cache</summary>
        ///<param name="mediaContentId">The id of the item to add</param>
        ///<param name="price">the price to display to the user</param>
        ///<param name="kontikiId">the kontiki id to store</param>
        ///<param name="statusKey">The status of the item</param>
        ///<param name="purchaseStatus">The purchase status of the item</param>
        ///<param name="syncsRemaining">Number of syncs remaining</param>
        this._cache.AddItemWithParams(mediaContentId, statusKey, price, purchaseStatus, syncsRemaining);
    },
    
     BuildCache: function()
    {
        ///<summary>Clears the cache and re-creates it the cache from scratch</summary>
        this._base.BuildCache();
    },
    
    _ListLibraryVideoIdAndMediaContentIds: function(videoIds, mediaContentIds)
    {
        ///<summary>Lists all video ids and content ids in the library</summary>
        this._base._ListLibraryVideoIdAndMediaContentIds(videoIds, mediaContentIds);
    },
    
    AddItemToCache: function(mediaContentId)
    {
        ///<summary>Adds an item to the cache</summary>
        ///<param name="mediaContentId">The id of the item to add</param>
        return this._cache.AddItem(mediaContentId);
    },
    
    GetItem: function(mediaContentId)
    {
        ///<summary>returns the cache data for the item</summary>
        ///<param name="mediaContentId">The id of the item to get</param>
        return this._base.GetItem(mediaContentId);
    },
     
    RemoveItem: function(mediaContentId)
    {
        ///<summary>removes the cache data for the item</summary>
        ///<param name="mediaContentId">The id of the item to remove</param>
        this._base.RemoveItem(mediaContentId);
    },
    
    _RequestItems: function(videoIds, mediaContentIds)
    {
        ///<summary>Builds and submits a request to the server for the list of items, throws an exception if the lists are of different lengths</summary>
        ///<param name="videoIds">The videoIds the server will use to get the cache items</param>
        ///<param name="">The mediaContentIds that the client can use as the item keys</param>
        
        this._base._RequestItems(videoIds, mediaContentIds);
    }
}
