Skip to content

Commit 11bcd68

Browse files
committed
Enhance frontend logging for sponsor fetching process by adding console logs to track the state of sponsor containers and API calls. Update authentication logic to skip checks for the GitHub sponsors API endpoint, and modify manifest URL fetching to use GitHub raw content for improved reliability.
1 parent f9d8bbd commit 11bcd68

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

frontend/templates/components/home_section.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1962,6 +1962,7 @@ <h3><i class="fas fa-download"></i> Swaparr Status</h3>
19621962
document.querySelector('.dashboard-grid').style.opacity = '1';
19631963
}, 25);
19641964
const sponsorContainer = document.getElementById('rotating-sponsor-content');
1965+
console.log('sponsorContainer:', sponsorContainer);
19651966
let sponsors = [];
19661967
let weightedSponsorPool = [];
19671968
let currentSponsorIndex = 0;
@@ -1987,6 +1988,8 @@ <h3><i class="fas fa-download"></i> Swaparr Status</h3>
19871988
// Apply transition styles for smooth sponsor changes
19881989
const avatarContainer = document.getElementById('sponsor-avatar-container');
19891990
const descContainer = document.getElementById('rotating-sponsor-content');
1991+
console.log('avatarContainer:', avatarContainer);
1992+
console.log('descContainer:', descContainer);
19901993

19911994
// Add transition effects but keep them faster
19921995
avatarContainer.style.transition = 'opacity 0.15s ease';
@@ -2141,12 +2144,16 @@ <h3><i class="fas fa-download"></i> Swaparr Status</h3>
21412144
}
21422145

21432146
// Show placeholder immediately
2147+
console.log('About to display placeholder sponsor');
21442148
displayPlaceholderSponsor();
2149+
console.log('Placeholder sponsor displayed');
21452150

21462151
// Fetch sponsors from the API
21472152
async function fetchSponsors() {
2153+
console.log('fetchSponsors function called');
21482154
try {
21492155
// Fetch in the background without waiting for visual updates
2156+
console.log('About to call HuntarrUtils.fetchWithTimeout');
21502157
const response = await HuntarrUtils.fetchWithTimeout('/api/github_sponsors');
21512158
if (!response.ok) {
21522159
throw new Error(`HTTP error! status: ${response.status}`);
@@ -2180,6 +2187,7 @@ <h3><i class="fas fa-download"></i> Swaparr Status</h3>
21802187
}
21812188

21822189
// Initialize sponsors on page load
2190+
console.log('About to fetch sponsors');
21832191
fetchSponsors();
21842192
});
21852193
</script>

src/primary/auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ def authenticate_request():
305305
logger.debug(f"Allowing setup/user page access for path: {request.path}")
306306
return None
307307

308-
# Skip authentication for static files, API setup, health check path, and ping
309-
if request.path.startswith((static_path, api_setup_path)) or request.path in (favicon_path, health_check_path, ping_path):
308+
# Skip authentication for static files, API setup, health check path, ping, and github sponsors
309+
if request.path.startswith((static_path, api_setup_path)) or request.path in (favicon_path, health_check_path, ping_path, '/api/github_sponsors', '/api/sponsors/init'):
310310
if not is_polling_endpoint:
311311
logger.debug(f"Skipping authentication for path '{request.path}' (static/api-setup/health/ping)")
312312
return None

src/primary/web_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,8 +1191,8 @@ def get_github_sponsors():
11911191
current_app.logger.error(f"Error reading sponsors cache: {e}")
11921192
# Continue to fetch fresh data
11931193

1194-
# Fetch from GitHub Pages manifest (no authentication needed)
1195-
manifest_url = "https://plexguide.github.io/Huntarr.io/manifest.json"
1194+
# Fetch from GitHub raw content since GitHub Pages isn't enabled
1195+
manifest_url = "https://raw.githubusercontent.com/plexguide/Huntarr.io/main/manifest.json"
11961196

11971197
try:
11981198
# Fetch the manifest with a reasonable timeout

0 commit comments

Comments
 (0)