maj
This commit is contained in:
@@ -10,35 +10,5 @@ async function PopulateSelect(mySelect,id){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function getDataProjectVideosFromApi(id) {
|
||||
try {
|
||||
const response = await $.ajax({
|
||||
url: api_url.concat(`/projects/${id}/videos`),
|
||||
method: "GET",
|
||||
dataType: "json",
|
||||
});
|
||||
// If the request is successful, store the data in the cache and return it
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.error("Error fetching data:", error);
|
||||
throw error; // Re-throw the error to handle it outside the function if needed
|
||||
}
|
||||
}
|
||||
|
||||
async function getDataVideoFromApi(id) {
|
||||
try {
|
||||
const response = await $.ajax({
|
||||
url: api_url.concat(`/videos/${id}`),
|
||||
method: "GET",
|
||||
dataType: "json",
|
||||
});
|
||||
// If the request is successful, store the data in the cache and return it
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.error("Error fetching data:", error);
|
||||
throw error; // Re-throw the error to handle it outside the function if needed
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,3 +42,38 @@ function getDataMetrics(projectId){
|
||||
return data;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
async function getDataProjectVideosFromApi(id) {
|
||||
try {
|
||||
const response = await $.ajax({
|
||||
url: api_url.concat(`/projects/${id}/videos`),
|
||||
method: "GET",
|
||||
dataType: "json",
|
||||
});
|
||||
// If the request is successful, store the data in the cache and return it
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.error("Error fetching data:", error);
|
||||
throw error; // Re-throw the error to handle it outside the function if needed
|
||||
}
|
||||
}
|
||||
|
||||
async function getDataVideoFromApi(id) {
|
||||
try {
|
||||
const response = await $.ajax({
|
||||
url: api_url.concat(`/videos/${id}`),
|
||||
method: "GET",
|
||||
dataType: "json",
|
||||
});
|
||||
// If the request is successful, store the data in the cache and return it
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.error("Error fetching data:", error);
|
||||
throw error; // Re-throw the error to handle it outside the function if needed
|
||||
}
|
||||
}
|
||||
|
||||
function postNewVideo(project_id, measurements_id, name_video, resolution, duration, fps, status){
|
||||
|
||||
}
|
||||
|
||||
@@ -13,3 +13,13 @@ function filterAndSortMeasurementsByIds(measurements, ids) {
|
||||
.filter((measurement) => ids.includes(measurement.id))
|
||||
.sort((a, b) => new Date(a.timestamp) - new Date(b.timestamp));
|
||||
}
|
||||
|
||||
function checkVideoPath(videos, name) {
|
||||
let res = true;
|
||||
videos.forEach(video => {
|
||||
const videoName = video.name;
|
||||
if(videoName==name)
|
||||
res=false;
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user