check pvr modified time on TV product 14/198814/3
authorchengyj1985 <yujie.cheng@samsung.com>
Wed, 30 Jan 2019 03:41:51 +0000 (11:41 +0800)
committerchengyj1985 <yujie.cheng@samsung.com>
Wed, 30 Jan 2019 03:54:29 +0000 (11:54 +0800)
Change-Id: I883333fa5857e5e91641103fd49db8ba90090784

src/common/media-common-db-svc.c

index a08176d..eebb152 100755 (executable)
@@ -340,7 +340,11 @@ int __ms_check_item_exist(sqlite3 *handle, const char *storage_id, const char *p
        MS_DBG_RETVM_IF(!MS_STRING_VALID(storage_id), MS_MEDIA_ERR_INVALID_PARAMETER, "storage_id is NULL");
        MS_DBG_RETVM_IF(!MS_STRING_VALID(path), MS_MEDIA_ERR_INVALID_PARAMETER, "path is NULL");
 
+#ifdef _USE_TVPD_MODE
+       sql = sqlite3_mprintf("SELECT modified_time, size, media_type, timeline FROM '%q' WHERE path='%q'", storage_id, path);
+#else
        sql = sqlite3_mprintf("SELECT modified_time, size FROM '%q' WHERE path='%q'", storage_id, path);
+#endif
 
        ret = media_db_get_result(handle, sql, &sql_stmt);
        if (ret != MS_MEDIA_ERR_NONE) {
@@ -354,7 +358,11 @@ int __ms_check_item_exist(sqlite3 *handle, const char *storage_id, const char *p
        } else {
                modified_time = (int)sqlite3_column_int(sql_stmt, 0);
                file_size = (unsigned long long)sqlite3_column_int64(sql_stmt, 1);
-
+#ifdef _USE_TVPD_MODE
+               int media_type = (int)sqlite3_column_int(sql_stmt, 2);
+               if (media_type == MS_MEDIA_TYPE_PVR)
+                       modified_time = (int)sqlite3_column_int(sql_stmt, 3);
+#endif
                memset(&st, 0, sizeof(struct stat));
                if (stat(path, &st) == 0) {
                        if ((st.st_mtime != modified_time) || (st.st_size != file_size))