[Content] Deprecate Playlist 38/308438/3
authorPiotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics <p.kosko@samsung.com>
Mon, 25 Mar 2024 13:38:42 +0000 (14:38 +0100)
committerPiotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics <p.kosko@samsung.com>
Fri, 5 Apr 2024 09:02:13 +0000 (11:02 +0200)
[ACR] https://jira.sec.samsung.net/browse/TWDAPI-295

[Verification] Code compiles without errors.

Change-Id: Iaff91998ee3cad1b128f55494087333e744bd59d

src/content/content_instance.cc
src/content/js/manager.js
src/content/js/playlist.js

index 9b46159..c6d4ac7 100644 (file)
@@ -32,6 +32,7 @@
 #include "content/content_manager.h"
 
 using namespace common;
+using common::tools::PrintDeprecationWarningFor;
 
 namespace extension {
 namespace content {
@@ -665,6 +666,7 @@ void ContentInstance::ContentManagerUnsetchangelistener(const picojson::value& a
 void ContentInstance::ContentManagerGetplaylists(const picojson::value& args,
                                                  picojson::object& out) {
   ScopeLogger();
+  PrintDeprecationWarningFor("ContentManagerGetplaylists");
   // CHECK_PRIVILEGE_ACCESS(kPrivilegeContentRead, &out);
   CHECK_PRIVILEGE_ACCESS(kPrivilegeContentWrite, &out);
 
@@ -689,6 +691,7 @@ void ContentInstance::ContentManagerGetplaylists(const picojson::value& args,
 void ContentInstance::ContentManagerCreateplaylist(const picojson::value& args,
                                                    picojson::object& out) {
   ScopeLogger();
+  PrintDeprecationWarningFor("ContentManagerCreateplaylist");
   CHECK_PRIVILEGE_ACCESS(kPrivilegeContentWrite, &out);
 
   CHECK_EXIST(args, "callbackId", out)
@@ -712,6 +715,7 @@ void ContentInstance::ContentManagerCreateplaylist(const picojson::value& args,
 void ContentInstance::ContentManagerRemoveplaylist(const picojson::value& args,
                                                    picojson::object& out) {
   ScopeLogger();
+  PrintDeprecationWarningFor("ContentManagerRemoveplaylist");
   CHECK_PRIVILEGE_ACCESS(kPrivilegeContentWrite, &out);
 
   double callbackId = args.get("callbackId").get<double>();
@@ -771,6 +775,7 @@ void ContentInstance::ContentManagerCreateThumbnail(const picojson::value& args,
 void ContentInstance::ContentManagerPlaylistAdd(const picojson::value& args,
                                                 picojson::object& out) {
   ScopeLogger();
+  PrintDeprecationWarningFor("ContentManagerPlaylistAdd");
   CHECK_PRIVILEGE_ACCESS(kPrivilegeContentWrite, &out);
 
   if (ContentManager::getInstance()->isConnected()) {
@@ -789,6 +794,7 @@ void ContentInstance::ContentManagerPlaylistAdd(const picojson::value& args,
 void ContentInstance::ContentManagerPlaylistAddbatch(const picojson::value& args,
                                                      picojson::object& out) {
   ScopeLogger();
+  PrintDeprecationWarningFor("ContentManagerPlaylistAddbatch");
   CHECK_PRIVILEGE_ACCESS(kPrivilegeContentWrite, &out);
 
   double callbackId = args.get("callbackId").get<double>();
@@ -809,6 +815,7 @@ void ContentInstance::ContentManagerPlaylistAddbatch(const picojson::value& args
 void ContentInstance::ContentManagerPlaylistGet(const picojson::value& args,
                                                 picojson::object& out) {
   ScopeLogger();
+  PrintDeprecationWarningFor("ContentManagerPlaylistGet");
   // CHECK_PRIVILEGE_ACCESS(kPrivilegeContentRead, &out);
   CHECK_PRIVILEGE_ACCESS(kPrivilegeContentWrite, &out);
 
@@ -830,6 +837,7 @@ void ContentInstance::ContentManagerPlaylistGet(const picojson::value& args,
 void ContentInstance::ContentManagerPlaylistRemove(const picojson::value& args,
                                                    picojson::object& out) {
   ScopeLogger();
+  PrintDeprecationWarningFor("ContentManagerPlaylistRemove");
   CHECK_PRIVILEGE_ACCESS(kPrivilegeContentWrite, &out);
 
   if (ContentManager::getInstance()->isConnected()) {
@@ -848,6 +856,7 @@ void ContentInstance::ContentManagerPlaylistRemove(const picojson::value& args,
 void ContentInstance::ContentManagerPlaylistRemovebatch(const picojson::value& args,
                                                         picojson::object& out) {
   ScopeLogger();
+  PrintDeprecationWarningFor("ContentManagerPlaylistRemovebatch");
   CHECK_PRIVILEGE_ACCESS(kPrivilegeContentWrite, &out);
 
   double callbackId = args.get("callbackId").get<double>();
@@ -868,6 +877,7 @@ void ContentInstance::ContentManagerPlaylistRemovebatch(const picojson::value& a
 void ContentInstance::ContentManagerPlaylistSetorder(const picojson::value& args,
                                                      picojson::object& out) {
   ScopeLogger();
+  PrintDeprecationWarningFor("ContentManagerPlaylistSetorder");
   CHECK_PRIVILEGE_ACCESS(kPrivilegeContentWrite, &out);
 
   double callbackId = args.get("callbackId").get<double>();
@@ -888,6 +898,7 @@ void ContentInstance::ContentManagerPlaylistSetorder(const picojson::value& args
 void ContentInstance::ContentManagerPlaylistMove(const picojson::value& args,
                                                  picojson::object& out) {
   ScopeLogger();
+  PrintDeprecationWarningFor("ContentManagerPlaylistMove");
   CHECK_PRIVILEGE_ACCESS(kPrivilegeContentWrite, &out);
 
   double callbackId = args.get("callbackId").get<double>();
@@ -930,6 +941,7 @@ void ContentInstance::ContentManagerAudioGetLyrics(const picojson::value& args,
 
 void ContentInstance::PlaylistGetName(const picojson::value& args, picojson::object& out) {
   ScopeLogger();
+  PrintDeprecationWarningFor("PlaylistGetName");
   int ret;
   CHECK_EXIST(args, "id", out)
   int id = static_cast<int>(args.get("id").get<double>());
@@ -944,6 +956,7 @@ void ContentInstance::PlaylistGetName(const picojson::value& args, picojson::obj
 
 void ContentInstance::PlaylistSetName(const picojson::value& args, picojson::object& out) {
   ScopeLogger();
+  PrintDeprecationWarningFor("PlaylistSetName");
   CHECK_PRIVILEGE_ACCESS(kPrivilegeContentWrite, &out);
 
   int ret;
@@ -961,6 +974,7 @@ void ContentInstance::PlaylistSetName(const picojson::value& args, picojson::obj
 
 void ContentInstance::PlaylistGetThumbnailUri(const picojson::value& args, picojson::object& out) {
   ScopeLogger();
+  PrintDeprecationWarningFor("PlaylistGetThumbnailUri");
   int ret;
   CHECK_EXIST(args, "id", out)
   int id = static_cast<int>(args.get("id").get<double>());
@@ -975,6 +989,7 @@ void ContentInstance::PlaylistGetThumbnailUri(const picojson::value& args, picoj
 
 void ContentInstance::PlaylistSetThumbnailUri(const picojson::value& args, picojson::object& out) {
   ScopeLogger();
+  PrintDeprecationWarningFor("PlaylistSetThumbnailUri");
   CHECK_PRIVILEGE_ACCESS(kPrivilegeContentWrite, &out);
 
   int ret;
@@ -997,6 +1012,7 @@ void ContentInstance::PlaylistSetThumbnailUri(const picojson::value& args, picoj
 void ContentInstance::PlaylistGetNumberOfTracks(const picojson::value& args,
                                                 picojson::object& out) {
   ScopeLogger();
+  PrintDeprecationWarningFor("PlaylistGetNumberOfTracks");
   CHECK_EXIST(args, "id", out)
   int id = static_cast<int>(args.get("id").get<double>());
   int count = 0;
index e3c0755..13be2d4 100755 (executable)
@@ -480,6 +480,10 @@ ContentManager.prototype.unsetChangeListener = function() {
 };
 
 ContentManager.prototype.getPlaylists = function(successCallback, errorCallback) {
+    privUtils_.deprecationWarn(
+        'getPlaylists() is deprecated since Tizen 9.0 with no replacement.',
+        '9.0'
+    );
     var args = validator_.validateArgs(arguments, [
         { name: 'successCallback', type: types_.FUNCTION },
         { name: 'errorCallback', type: types_.FUNCTION, optional: true, nullable: true }
@@ -513,6 +517,10 @@ ContentManager.prototype.createPlaylist = function(
     errorCallback,
     sourcePlaylist
 ) {
+    privUtils_.deprecationWarn(
+        'createPlaylist() is deprecated since Tizen 9.0 with no replacement.',
+        '9.0'
+    );
     var args = validator_.validateArgs(arguments, [
         { name: 'name', type: types_.STRING },
         { name: 'successCallback', type: types_.FUNCTION },
@@ -561,6 +569,10 @@ ContentManager.prototype.createPlaylist = function(
 };
 
 ContentManager.prototype.removePlaylist = function(id, successCallback, errorCallback) {
+    privUtils_.deprecationWarn(
+        'removePlaylist() is deprecated since Tizen 9.0 with no replacement.',
+        '9.0'
+    );
     var args = validator_.validateArgs(arguments, [
         { name: 'id', type: types_.STRING },
         {
index 95e3d35..d37f904 100755 (executable)
@@ -20,6 +20,10 @@ function Playlist(data) {
     Object.defineProperties(this, {
         id: {
             get: function() {
+                privUtils_.deprecationWarn(
+                    'Playlist.id is deprecated since Tizen 9.0 with no replacement.',
+                    '9.0'
+                );
                 return id;
             },
             set: function(v) {
@@ -31,6 +35,10 @@ function Playlist(data) {
         },
         name: {
             get: function() {
+                privUtils_.deprecationWarn(
+                    'Playlist.name is deprecated since Tizen 9.0 with no replacement.',
+                    '9.0'
+                );
                 var result = native_.callSync('PlaylistGetName', {
                     id: Number(id)
                 });
@@ -40,6 +48,10 @@ function Playlist(data) {
                 return native_.getResultObject(result);
             },
             set: function(v) {
+                privUtils_.deprecationWarn(
+                    'Playlist.name is deprecated since Tizen 9.0 with no replacement.',
+                    '9.0'
+                );
                 if (!type_.isNull(v)) {
                     var name = converter_.toString(v, false);
                     var result = native_.callSync('PlaylistSetName', {
@@ -55,6 +67,10 @@ function Playlist(data) {
         },
         numberOfTracks: {
             get: function() {
+                privUtils_.deprecationWarn(
+                    'Playlist.numberOfTracks is deprecated since Tizen 9.0 with no replacement.',
+                    '9.0'
+                );
                 var result = native_.callSync('PlaylistGetNumberOfTracks', {
                     id: Number(id)
                 });
@@ -68,6 +84,10 @@ function Playlist(data) {
         },
         thumbnailURI: {
             get: function() {
+                privUtils_.deprecationWarn(
+                    'Playlist.thumbnailURI is deprecated since Tizen 9.0 with no replacement.',
+                    '9.0'
+                );
                 var result = native_.callSync('PlaylistGetThumbnailUri', {
                     id: Number(id)
                 });
@@ -80,6 +100,10 @@ function Playlist(data) {
                 return res === ' ' ? null : res;
             },
             set: function(v) {
+                privUtils_.deprecationWarn(
+                    'Playlist.thumbnailURI is deprecated since Tizen 9.0 with no replacement.',
+                    '9.0'
+                );
                 var thumbnailURI = converter_.toString(v, true);
                 if (type_.isNullOrUndefined(thumbnailURI)) {
                     //CoreAPI not support empty thumbnail, so one space must be used
@@ -113,6 +137,10 @@ function Playlist(data) {
 }
 
 Playlist.prototype.add = function(item) {
+    privUtils_.deprecationWarn(
+        'add() is deprecated since Tizen 9.0 with no replacement.',
+        '9.0'
+    );
     var args = validator_.validateArgs(arguments, [
         { name: 'item', type: types_.PLATFORM_OBJECT, values: Content }
     ]);
@@ -129,6 +157,10 @@ Playlist.prototype.add = function(item) {
 };
 
 Playlist.prototype.addBatch = function(items, successCallback, errorCallback) {
+    privUtils_.deprecationWarn(
+        'addBatch() is deprecated since Tizen 9.0 with no replacement.',
+        '9.0'
+    );
     var args = validator_.validateArgs(arguments, [
         { name: 'items', type: types_.ARRAY, values: Content },
         {
@@ -161,6 +193,10 @@ Playlist.prototype.addBatch = function(items, successCallback, errorCallback) {
 };
 
 Playlist.prototype.remove = function(item) {
+    privUtils_.deprecationWarn(
+        'remove() is deprecated since Tizen 9.0 with no replacement.',
+        '9.0'
+    );
     var args = validator_.validateArgs(arguments, [
         { name: 'item', type: types_.PLATFORM_OBJECT, values: PlaylistItem }
     ]);
@@ -177,6 +213,10 @@ Playlist.prototype.remove = function(item) {
 };
 
 Playlist.prototype.removeBatch = function(items, successCallback, errorCallback) {
+    privUtils_.deprecationWarn(
+        'removeBatch() is deprecated since Tizen 9.0 with no replacement.',
+        '9.0'
+    );
     var args = validator_.validateArgs(arguments, [
         { name: 'items', type: types_.ARRAY, values: PlaylistItem },
         {
@@ -214,6 +254,10 @@ Playlist.prototype.removeBatch = function(items, successCallback, errorCallback)
 };
 
 Playlist.prototype.get = function(successCallback, errorCallback, count, offset) {
+    privUtils_.deprecationWarn(
+        'get() is deprecated since Tizen 9.0 with no replacement.',
+        '9.0'
+    );
     var args = validator_.validateArgs(arguments, [
         { name: 'successCallback', type: types_.FUNCTION },
         { name: 'errorCallback', type: types_.FUNCTION, optional: true, nullable: true },
@@ -257,6 +301,10 @@ Playlist.prototype.get = function(successCallback, errorCallback, count, offset)
 };
 
 Playlist.prototype.setOrder = function(items, successCallback, errorCallback) {
+    privUtils_.deprecationWarn(
+        'setOrder() is deprecated since Tizen 9.0 with no replacement.',
+        '9.0'
+    );
     var args = validator_.validateArgs(arguments, [
         { name: 'items', type: types_.ARRAY, values: PlaylistItem },
         {
@@ -301,6 +349,10 @@ Playlist.prototype.setOrder = function(items, successCallback, errorCallback) {
 };
 
 Playlist.prototype.move = function(item, delta, successCallback, errorCallback) {
+    privUtils_.deprecationWarn(
+        'move() is deprecated since Tizen 9.0 with no replacement.',
+        '9.0'
+    );
     var args = validator_.validateArgs(arguments, [
         { name: 'item', type: types_.PLATFORM_OBJECT, values: PlaylistItem },
         { name: 'delta', type: types_.LONG },