Skip to content

Commit

Permalink
[MediaContent] Deprecate all Bookmark and Playlist APIs (#6240)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsgwon authored Aug 8, 2024
1 parent e8c338f commit 8488756
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Tizen.Content.MediaContent/Interop/Interop.MediaInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ internal static extern MediaContentError ForeachTags(string mediaId, FilterHandl
Common.ItemCallback callback, IntPtr userData = default); // Deprecated since API12

[DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_bookmark_count_from_db")]
internal static extern MediaContentError GetBookmarkCount(string mediaId, FilterHandle filter, out int bookmarkCount);
internal static extern MediaContentError GetBookmarkCount(string mediaId, FilterHandle filter, out int bookmarkCount); // Deprecated since API12

[DllImport(Libraries.MediaContent, EntryPoint = "media_info_foreach_bookmark_from_db")]
internal static extern MediaContentError ForeachBookmarks(string mediaId, FilterHandle filter,
Common.ItemCallback callback, IntPtr userData = default);
Common.ItemCallback callback, IntPtr userData = default); // Deprecated since API12

[DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_face_count_from_db")]
internal static extern MediaContentError GetFaceCount(string mediaId, FilterHandle filter, out int bookmarkCount); // Deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace Tizen.Content.MediaContent
/// in media (video and audio) to enable fast searching.
/// </summary>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public class Bookmark
{
internal Bookmark(IntPtr handle)
Expand All @@ -38,27 +39,31 @@ internal Bookmark(IntPtr handle)
/// </summary>
/// <value>The ID of the bookmark.</value>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public int Id { get; }

/// <summary>
/// Gets the thumbnail path of the bookmark.
/// </summary>
/// <value>The thumbnail path of the bookmark.</value>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public string ThumbnailPath { get; }

/// <summary>
/// Gets the offset in milliseconds.
/// </summary>
/// <value>The offset of the bookmark in media in milliseconds.</value>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public int Offset { get; }

/// <summary>
/// Gets the name of the bookmark.
/// </summary>
/// <value>The name of the bookmark.</value>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public string Name { get; }

internal static Bookmark FromHandle(IntPtr handle) => new Bookmark(handle);
Expand All @@ -68,6 +73,7 @@ internal Bookmark(IntPtr handle)
/// </summary>
/// <returns>A string representation of the current bookmark.</returns>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public override string ToString() =>
$"Id={Id}, Name={Name}, ThumbnailPath={ThumbnailPath}, Offset={Offset}";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace Tizen.Content.MediaContent
/// </summary>
/// <seealso cref="Bookmark"/>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public class BookmarkCommand : MediaCommand
{
/// <summary>
Expand All @@ -32,6 +33,7 @@ public class BookmarkCommand : MediaCommand
/// <exception cref="ArgumentNullException"><paramref name="database"/> is null.</exception>
/// <exception cref="ObjectDisposedException"><paramref name="database"/> has already been disposed.</exception>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public BookmarkCommand(MediaDatabase database) : base(database)
{
}
Expand All @@ -44,6 +46,7 @@ public BookmarkCommand(MediaDatabase database) : base(database)
/// <exception cref="ObjectDisposedException">The <see cref="MediaDatabase"/> has already been disposed.</exception>
/// <exception cref="MediaDatabaseException">An error occurred while executing the command.</exception>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public int Count()
{
return Count(null);
Expand All @@ -58,6 +61,7 @@ public int Count()
/// <exception cref="ObjectDisposedException">The <see cref="MediaDatabase"/> has already been disposed.</exception>
/// <exception cref="MediaDatabaseException">An error occurred while executing the command.</exception>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public int Count(CountArguments arguments)
{
ValidateDatabase();
Expand All @@ -79,6 +83,7 @@ public int Count(CountArguments arguments)
/// <exception cref="ArgumentException"><paramref name="mediaId"/> is a zero-length string, contains only white space.</exception>
/// <exception cref="UnauthorizedAccessException">The caller has no required privilege.</exception>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public Bookmark Insert(string mediaId, int offset)
{
return Insert(mediaId, offset, null);
Expand All @@ -99,6 +104,7 @@ public Bookmark Insert(string mediaId, int offset)
/// <exception cref="ArgumentException"><paramref name="mediaId"/> is a zero-length string, contains only white space.</exception>
/// <exception cref="UnauthorizedAccessException">The caller has no required privilege.</exception>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public Bookmark Insert(string mediaId, int offset, string name)
{
return Insert(mediaId, offset, name, null);
Expand All @@ -123,6 +129,7 @@ public Bookmark Insert(string mediaId, int offset, string name)
/// <exception cref="ArgumentException"><paramref name="mediaId"/> is a zero-length string, contains only white space.</exception>
/// <exception cref="UnauthorizedAccessException">The caller has no required privilege.</exception>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public Bookmark Insert(string mediaId, int offset, string name, string thumbnailPath)
{
ValidateDatabase();
Expand Down Expand Up @@ -163,6 +170,7 @@ public Bookmark Insert(string mediaId, int offset, string name, string thumbnail
/// <exception cref="ArgumentOutOfRangeException"><paramref name="bookmarkId"/> is less than zero.</exception>
/// <exception cref="UnauthorizedAccessException">The caller has no required privilege.</exception>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public bool Delete(int bookmarkId)
{
ValidateDatabase();
Expand Down Expand Up @@ -192,6 +200,7 @@ public bool Delete(int bookmarkId)
/// <exception cref="ObjectDisposedException">The <see cref="MediaDatabase"/> has already been disposed.</exception>
/// <exception cref="MediaDatabaseException">An error occurred while executing the command.</exception>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public MediaDataReader<Bookmark> Select()
{
return Select(null);
Expand All @@ -206,6 +215,7 @@ public MediaDataReader<Bookmark> Select()
/// <exception cref="ObjectDisposedException">The <see cref="MediaDatabase"/> has already been disposed.</exception>
/// <exception cref="MediaDatabaseException">An error occurred while executing the command.</exception>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public MediaDataReader<Bookmark> Select(SelectArguments filter)
{
ValidateDatabase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ public static class FolderColumns
/// <seealso cref="PlaylistCommand.Count(CountArguments)"/>
/// <seealso cref="PlaylistCommand.Select(SelectArguments)"/>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public static class PlaylistColumns
{
/// <summary>
Expand All @@ -476,6 +477,7 @@ public static class PlaylistColumns
/// </remarks>
/// <seealso cref="Playlist.Name"/>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public static string Name => "PLAYLIST_NAME";

/// <summary>
Expand All @@ -487,6 +489,7 @@ public static class PlaylistColumns
/// </remarks>
/// <seealso cref="Playlist.Id"/>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public static string Id => "PLAYLIST_ID";

/// <summary>
Expand All @@ -498,6 +501,7 @@ public static class PlaylistColumns
/// </remarks>
/// <seealso cref="PlaylistCommand.UpdatePlayOrder(int, PlayOrder)"/>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public static string MemberOrder => "PLAYLIST_MEMBER_ORDER";

/// <summary>
Expand All @@ -510,6 +514,7 @@ public static class PlaylistColumns
/// <seealso cref="PlaylistCommand.AddMember(int, string)"/>
/// <seealso cref="PlaylistCommand.RemoveMember(int, int)"/>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public static string Count => "PLAYLIST_MEDIA_COUNT";
}

Expand Down Expand Up @@ -579,6 +584,7 @@ public static class TagColumns
/// <seealso cref="MediaInfoCommand.CountBookmark(string, CountArguments)"/>
/// <seealso cref="MediaInfoCommand.SelectBookmark(string, SelectArguments)"/>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public static class BookmarkColumns
{
/// <summary>
Expand All @@ -590,6 +596,7 @@ public static class BookmarkColumns
/// </remarks>
/// <seealso cref="Bookmark.Offset"/>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public static string Offset => "BOOKMARK_MARKED_TIME";

/// <summary>
Expand All @@ -601,6 +608,7 @@ public static class BookmarkColumns
/// </remarks>
/// <seealso cref="Bookmark.Id"/>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public static string Id => "BOOKMARK_ID";

/// <summary>
Expand All @@ -612,6 +620,7 @@ public static class BookmarkColumns
/// </remarks>
/// <seealso cref="Bookmark.Name"/>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public static string Name => "BOOKMARK_NAME";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public MediaInfoCommand(MediaDatabase database) : base(database)
/// <exception cref="ArgumentNullException"><paramref name="mediaId"/> is null.</exception>
/// <exception cref="ArgumentException"><paramref name="mediaId"/> is a zero-length string, contains only white space.</exception>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public int CountBookmark(string mediaId)
{
return CountBookmark(mediaId, null);
Expand All @@ -70,6 +71,7 @@ public int CountBookmark(string mediaId)
/// <exception cref="ArgumentNullException"><paramref name="mediaId"/> is null.</exception>
/// <exception cref="ArgumentException"><paramref name="mediaId"/> is a zero-length string, contains only white space.</exception>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public int CountBookmark(string mediaId, CountArguments arguments)
{
ValidateDatabase();
Expand All @@ -90,6 +92,7 @@ public int CountBookmark(string mediaId, CountArguments arguments)
/// <exception cref="ArgumentNullException"><paramref name="mediaId"/> is null.</exception>
/// <exception cref="ArgumentException"><paramref name="mediaId"/> is a zero-length string, contains only white space.</exception>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public MediaDataReader<Bookmark> SelectBookmark(string mediaId)
{
return SelectBookmark(mediaId, null);
Expand All @@ -107,6 +110,7 @@ public MediaDataReader<Bookmark> SelectBookmark(string mediaId)
/// <exception cref="ArgumentNullException"><paramref name="mediaId"/> is null.</exception>
/// <exception cref="ArgumentException"><paramref name="mediaId"/> is a zero-length string, contains only white space.</exception>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public MediaDataReader<Bookmark> SelectBookmark(string mediaId, SelectArguments filter)
{
ValidateDatabase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace Tizen.Content.MediaContent
/// Represents the playlist that is a group of media (usually songs).
/// </summary>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public class Playlist
{
internal Playlist(IntPtr handle)
Expand All @@ -39,27 +40,31 @@ internal Playlist(IntPtr handle)
/// </summary>
/// <value>The unique ID of the playlist.</value>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public int Id { get; }

/// <summary>
/// Gets the name of the playlist.
/// </summary>
/// <value>The name of the playlist.</value>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public string Name { get; }

/// <summary>
/// Gets the path to the thumbnail.
/// </summary>
/// <value>The path to the thumbnail.</value>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public string ThumbnailPath { get; }

/// <summary>
/// Returns a string representation of the playlist.
/// </summary>
/// <returns>A string representation of the current playlist.</returns>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public override string ToString() =>
$"Id={Id}, Name={Name}, ThumbnailPath={ThumbnailPath}";
}
Expand All @@ -72,6 +77,7 @@ public override string ToString() =>
/// </remarks>
/// <seealso cref="PlaylistCommand.Update (int, PlaylistUpdateValues)"/>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public class PlaylistUpdateValues
{
/// <summary>
Expand All @@ -80,6 +86,7 @@ public class PlaylistUpdateValues
/// <remarks>If the value is null, the update operation will have no effect on the field.</remarks>
/// <value>A string for name; the field will not be updated if null.</value>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public string Name { get; set; }

/// <summary>
Expand All @@ -88,13 +95,15 @@ public class PlaylistUpdateValues
/// <remarks>If the value is null, the update operation will have no effect on the field.</remarks>
/// <value>A string for the thumbnail path; the field will not be updated if null.</value>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public string ThumbnailPath { get; set; }
}

/// <summary>
/// Represents an order of a member of the playlist.
/// </summary>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public class PlayOrder
{
/// <summary>
Expand All @@ -108,6 +117,7 @@ public class PlayOrder
/// <paramref name="orderValue"/> is less than zero.
/// </exception>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public PlayOrder(int memberId, int orderValue)
{
MemberId = memberId;
Expand All @@ -124,6 +134,7 @@ public PlayOrder(int memberId, int orderValue)
/// <paramref name="value"/> is less than or equal to zero.
/// </exception>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public int MemberId
{
get => _memberId;
Expand All @@ -148,6 +159,7 @@ public int MemberId
/// <paramref name="value"/> is less than zero.
/// </exception>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Deprecated since API12. Will be removed in API14.")]
public int Value
{
get => _value;
Expand Down
Loading

0 comments on commit 8488756

Please sign in to comment.