Skip to content
Snippets Groups Projects
Commit 9e3e0edd authored by Steve Lhomme's avatar Steve Lhomme
Browse files

fetcher: don't mark fetched as false on success

On success the code in the error label was used, resulting in a failed
status reported.

Now we assume it failed by default and set to success on success.
parent 3f613a85
No related branches found
No related tags found
1 merge request!4856fetcher: don't mark fetched as false on success
Pipeline #432163 passed with stage
in 20 minutes and 52 seconds
...@@ -303,7 +303,7 @@ static void RunDownloader(void *userdata) ...@@ -303,7 +303,7 @@ static void RunDownloader(void *userdata)
{ {
vlc_thread_set_name("vlc-run-fetcher"); vlc_thread_set_name("vlc-run-fetcher");
bool fetched = true; bool fetched = false;
struct task *task = userdata; struct task *task = userdata;
input_fetcher_t *fetcher = task->fetcher; input_fetcher_t *fetcher = task->fetcher;
...@@ -313,16 +313,19 @@ static void RunDownloader(void *userdata) ...@@ -313,16 +313,19 @@ static void RunDownloader(void *userdata)
char *psz_arturl = input_item_GetArtURL( task->item ); char *psz_arturl = input_item_GetArtURL( task->item );
if( !psz_arturl ) if( !psz_arturl )
goto error; goto out;
if( !strncasecmp( psz_arturl, "file://", 7 ) || if( !strncasecmp( psz_arturl, "file://", 7 ) ||
!strncasecmp( psz_arturl, "attachment://", 13 ) ) !strncasecmp( psz_arturl, "attachment://", 13 ) )
{
fetched = true;
goto out; /* no fetch required */ goto out; /* no fetch required */
}
stream_t* source = vlc_stream_NewURL( fetcher->owner, psz_arturl ); stream_t* source = vlc_stream_NewURL( fetcher->owner, psz_arturl );
if( !source ) if( !source )
goto error; goto out;
struct vlc_memstream output_stream; struct vlc_memstream output_stream;
vlc_memstream_open( &output_stream ); vlc_memstream_open( &output_stream );
...@@ -342,12 +345,12 @@ static void RunDownloader(void *userdata) ...@@ -342,12 +345,12 @@ static void RunDownloader(void *userdata)
vlc_stream_Delete( source ); vlc_stream_Delete( source );
if( vlc_memstream_close( &output_stream ) ) if( vlc_memstream_close( &output_stream ) )
goto error; goto out;
if( vlc_killed() ) if( vlc_killed() )
{ {
free( output_stream.ptr ); free( output_stream.ptr );
goto error; goto out;
} }
input_SaveArt( fetcher->owner, task->item, output_stream.ptr, input_SaveArt( fetcher->owner, task->item, output_stream.ptr,
...@@ -355,9 +358,8 @@ static void RunDownloader(void *userdata) ...@@ -355,9 +358,8 @@ static void RunDownloader(void *userdata)
free( output_stream.ptr ); free( output_stream.ptr );
AddAlbumCache( fetcher, task->item, true ); AddAlbumCache( fetcher, task->item, true );
fetched = true;
error:
fetched = false;
out: out:
vlc_interrupt_set(NULL); vlc_interrupt_set(NULL);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment