mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 05:13:18 -07:00
A bit more logging for #32
This commit is contained in:
parent
13ee1efd86
commit
a686832e3f
1 changed files with 169 additions and 162 deletions
|
@ -24,10 +24,7 @@
|
||||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
// ************************************************************************/
|
// ************************************************************************/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Cryptography.X509Certificates;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
@ -106,10 +103,11 @@ namespace PlexRequests.UI.Helpers
|
||||||
counter++;
|
counter++;
|
||||||
Log.Trace("Artist is still not present in the index. Counter = {0}", counter);
|
Log.Trace("Artist is still not present in the index. Counter = {0}", counter);
|
||||||
index = await Api.GetIndex(Settings.ApiKey, Settings.FullUri);
|
index = await Api.GetIndex(Settings.ApiKey, Settings.FullUri);
|
||||||
//Fetch failed name
|
|
||||||
if (counter > CounterMax)
|
if (counter > CounterMax)
|
||||||
{
|
{
|
||||||
Log.Trace("Artist is still not present in the index. Counter = {0}. Returning false", counter);
|
Log.Trace("Artist is still not present in the index. Counter = {0}. Returning false", counter);
|
||||||
|
Log.Warn("We have tried adding the artist but it seems they are still not in headphones.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,11 +115,18 @@ namespace PlexRequests.UI.Helpers
|
||||||
var artistName = addedArtist?.ArtistName ?? string.Empty;
|
var artistName = addedArtist?.ArtistName ?? string.Empty;
|
||||||
while (artistName.Contains("Fetch failed"))
|
while (artistName.Contains("Fetch failed"))
|
||||||
{
|
{
|
||||||
|
Thread.Sleep(WaitTime);
|
||||||
await Api.RefreshArtist(Settings.ApiKey, Settings.FullUri, request.ArtistId);
|
await Api.RefreshArtist(Settings.ApiKey, Settings.FullUri, request.ArtistId);
|
||||||
|
|
||||||
index = await Api.GetIndex(Settings.ApiKey, Settings.FullUri);
|
index = await Api.GetIndex(Settings.ApiKey, Settings.FullUri);
|
||||||
|
|
||||||
artistName = index?.FirstOrDefault(x => x.ArtistID == request.ArtistId)?.ArtistName ?? string.Empty;
|
artistName = index?.FirstOrDefault(x => x.ArtistID == request.ArtistId)?.ArtistName ?? string.Empty;
|
||||||
|
if (counter > CounterMax)
|
||||||
|
{
|
||||||
|
Log.Trace("Artist fetch has failed. Counter = {0}. Returning false", counter);
|
||||||
|
Log.Warn("Artist in headphones fetch has failed, we have tried refreshing the artist but no luck.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
counter = 0;
|
counter = 0;
|
||||||
|
@ -136,6 +141,7 @@ namespace PlexRequests.UI.Helpers
|
||||||
if (counter > CounterMax)
|
if (counter > CounterMax)
|
||||||
{
|
{
|
||||||
Log.Trace("Artist status is still not active. Counter = {0}. Returning false", counter);
|
Log.Trace("Artist status is still not active. Counter = {0}. Returning false", counter);
|
||||||
|
Log.Warn("The artist status is still not Active. We have waited long enough, seems to be a big delay in headphones.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -156,6 +162,7 @@ namespace PlexRequests.UI.Helpers
|
||||||
if (counter > CounterMax)
|
if (counter > CounterMax)
|
||||||
{
|
{
|
||||||
Log.Trace("Album status is still not active. Counter = {0}. Returning false", counter);
|
Log.Trace("Album status is still not active. Counter = {0}. Returning false", counter);
|
||||||
|
Log.Warn("We tried to se the status for the album but headphones didn't want to snatch it.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue