Update change log and spec for wrt-plugins-tizen_0.4.57
[platform/framework/web/wrt-plugins-tizen.git] / src / Content / JSContent.cpp
index fd8cd3d..35cf614 100755 (executable)
@@ -280,7 +280,7 @@ JSValueRef JSMedia::getPropertyDescription(
     {
         Converter converter(context);
         MediacontentMediaPtr media = getMediaObject(object);
-        if(!(media->getDescription().empty()))
+//        if(!(media->getDescription().empty()))
         {
             return converter.toJSValueRef(media->getDescription());
         }
@@ -449,21 +449,19 @@ bool      JSMedia::setPropertyRating(
        MediacontentMediaPtr objMedia = getMediaObject(object);
        int rating = converter.toInt(value);
 
-       if(rating < 0)
+       if(rating < 0 || rating > 10)
        {
-               rating = 0;
+            Throw(WrtDeviceApis::Commons::InvalidArgumentException);
        }
        if ( objMedia->getRating() != rating)
        {
-               objMedia->setRating(rating, true);
+            objMedia->setRating(rating, true);
        }
-               
-        return true;
+       return true;
     }
     Catch(Exception)
     {
         LoggerW("trying to set incorrect value");
-        DeviceAPI::Common::JSWebAPIErrorFactory::postException(context, exception, DeviceAPI::Common::JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR);
     }
 
     return false;
@@ -487,13 +485,12 @@ bool JSMedia::setPropertyDisplayName(
                {
                        objMedia->setDisplayName(displayName, true);
                }
-               
+
                return true;
        }
        Catch(Exception)
        {
                LoggerW("trying to set incorrect value");
-               DeviceAPI::Common::JSWebAPIErrorFactory::postException(context, exception, DeviceAPI::Common::JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR);
        }
 
        return false;
@@ -522,9 +519,7 @@ bool JSMedia::setPropertyDescription(
        Catch(Exception)
        {
                LoggerW("trying to set incorrect value");
-               DeviceAPI::Common::JSWebAPIErrorFactory::postException(context, exception, DeviceAPI::Common::JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR);
        }
-
        return false;
 }