Commit 91d19753 authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: update art requests to use updated API

parent 41af9ab2
......@@ -705,7 +705,7 @@ void CoverArtLabel::showArtUpdate( input_item_t *_p_item )
void CoverArtLabel::askForUpdate()
{
THEMIM->getIM()->requestArtUpdate( p_item );
THEMIM->getIM()->requestArtUpdate( p_item, true );
}
void CoverArtLabel::setArtFromFile()
......
......@@ -206,7 +206,7 @@ void VLCModel::ensureArtRequested( const QModelIndex &index )
{
child = index.child( row, COLUMN_COVER );
if ( child.isValid() && child.data().toString().isEmpty() )
THEMIM->getIM()->requestArtUpdate( getInputItem( child ) );
THEMIM->getIM()->requestArtUpdate( getInputItem( child ), false );
}
}
}
......
......@@ -636,7 +636,7 @@ void InputManager::UpdateCaching()
}
}
void InputManager::requestArtUpdate( input_item_t *p_item )
void InputManager::requestArtUpdate( input_item_t *p_item, bool b_forced )
{
bool b_current_item = false;
if ( !p_item && hasInput() )
......@@ -648,13 +648,15 @@ void InputManager::requestArtUpdate( input_item_t *p_item )
if ( p_item )
{
/* check if it has already been enqueued */
if ( p_item->p_meta )
if ( p_item->p_meta && !b_forced )
{
int status = vlc_meta_GetStatus( p_item->p_meta );
if ( status & ( ITEM_ART_NOTFOUND|ITEM_ART_FETCHED ) )
return;
}
libvlc_ArtRequest( p_intf->p_libvlc, p_item, META_REQUEST_OPTION_NONE );
libvlc_ArtRequest( p_intf->p_libvlc, p_item,
(b_forced) ? META_REQUEST_OPTION_ANY
: META_REQUEST_OPTION_NONE );
/* No input will signal the cover art to update,
* let's do it ourself */
if ( b_current_item )
......
......@@ -141,7 +141,7 @@ public:
bool hasAudio();
bool hasVideo() { return hasInput() && b_video; }
bool hasVisualisation();
void requestArtUpdate( input_item_t *p_item );
void requestArtUpdate( input_item_t *p_item, bool b_forced );
void setArt( input_item_t *p_item, QString fileUrl );
QString getName() { return oldName; }
......
......@@ -385,6 +385,23 @@ static void *Thread( void *p_data )
if( !p_item )
break;
meta_fetcher_scope_t e_prev_scope = p_fetcher->e_scope;
/* scope override */
switch ( i_options ) {
case META_REQUEST_OPTION_ANY:
p_fetcher->e_scope = FETCHER_SCOPE_ANY;
break;
case META_REQUEST_OPTION_LOCAL:
p_fetcher->e_scope = FETCHER_SCOPE_LOCAL;
break;
case META_REQUEST_OPTION_NETWORK:
p_fetcher->e_scope = FETCHER_SCOPE_NETWORK;
break;
case META_REQUEST_OPTION_NONE:
default:
break;
}
/* Triggers "meta fetcher", eventually fetch meta on the network.
* They are identical to "meta reader" expect that may actually
* takes time. That's why they are running here.
......@@ -396,6 +413,7 @@ static void *Thread( void *p_data )
if( i_ret == 1 )
i_ret = DownloadArt( p_fetcher, p_item );
p_fetcher->e_scope = e_prev_scope;
/* */
char *psz_name = input_item_GetName( p_item );
if( !i_ret ) /* Art is now in cache */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment