Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

Commit

Permalink
Add support to Focus Concursos
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartatz committed Oct 15, 2023
1 parent bdf13fd commit 66ebf17
Show file tree
Hide file tree
Showing 7 changed files with 1,026 additions and 2 deletions.
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ endif()

option(ARA_DISABLE_IAEXPERT "Disable support for IA Expert Academy" OFF)
option(ARA_DISABLE_LOJA_CONCURSEIRO "Disable support for Loja do Concurseiro" OFF)
option(ARA_DISABLE_FOCUS_CONCURSOS "Disable support for Focus Concursos" OFF)

option(ARA_DISABLE_CERTIFICATE_VALIDATION "Disable SSL certificate validation in libcurl" OFF)

Expand Down Expand Up @@ -744,6 +745,7 @@ add_executable(
src/ffmpeg.c
src/walkdir.c
src/ttidy.c
src/uri.c
)

if (NOT (WIN32 OR SERENITYOS))
Expand Down Expand Up @@ -894,6 +896,20 @@ else()
)
endif()

if (ARA_DISABLE_FOCUS_CONCURSOS)
target_compile_definitions(
ara
PRIVATE
ARA_DISABLE_FOCUS_CONCURSOS
)
else()
target_sources(
ara
PRIVATE
src/focus_concursos.c
)
endif()

foreach(target ara ara-install)
target_compile_options(
${target}
Expand Down
4 changes: 2 additions & 2 deletions src/estrategia_concursos.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ int estrategia_concursos_get_resources(
.url = malloc(strlen(ESTRATEGIA_CONCURSOS_COURSE_HOMEPAGE) + strlen(SLASH) + strlen(sid) + strlen(SLASH) + strlen(AULAS) + 1)
};

if (resource.id == NULL || resource.name == NULL || resource.dirname == NULL || resource.short_dirname == NULL || resource.qualification.id == NULL || resource.qualification.name == NULL || resource.qualification.dirname == NULL || resource.qualification.short_dirname == NULL) {
if (resource.id == NULL || resource.name == NULL || resource.dirname == NULL || resource.short_dirname == NULL || resource.qualification.id == NULL || resource.qualification.name == NULL || resource.qualification.dirname == NULL || resource.qualification.short_dirname == NULL || resource.url == NULL) {
return UERR_MEMORY_ALLOCATE_FAILURE;
}

Expand Down Expand Up @@ -1122,7 +1122,7 @@ int estrategia_concursos_get_module(
.video = {
.id = malloc(strlen(sid) + 1),
.filename = malloc(strlen(name) + strlen(DOT) + strlen(MP4_FILE_EXTENSION) + 1),
.short_filename = malloc(strlen(name) + strlen(DOT) + strlen(MP4_FILE_EXTENSION) + 1),
.short_filename = malloc(strlen(sid) + strlen(DOT) + strlen(MP4_FILE_EXTENSION) + 1),
.url = malloc(strlen(stream_uri) + 1)
}
};
Expand Down
Loading

0 comments on commit 66ebf17

Please sign in to comment.