#!/usr/bin/env python3
"""Test Instagram notification with mixed content types"""

import sys
import json
from pathlib import Path

sys.path.insert(0, str(Path(__file__).parent))
sys.path.insert(0, str(Path(__file__).parent / 'modules'))

from modules.pushover_notifier import PushoverNotifier

def load_config():
    config_path = Path(__file__).parent / 'config' / 'settings.json'
    with open(config_path, 'r') as f:
        return json.load(f)

# Load config
config = load_config()
pushover_config = config.get('pushover', {})

# Create notifier
notifier = PushoverNotifier(
    user_key=pushover_config.get('user_key'),
    api_token=pushover_config.get('api_token'),
    enabled=True
)

# Simulate Instagram download - mixed content from evalongoria
# 5 posts + 3 stories + 2 reels = 10 total
downloads = []

# Add 5 posts
for i in range(5):
    downloads.append({
        'source': 'evalongoria',
        'content_type': 'post',
        'filename': None
    })

# Add 3 stories
for i in range(3):
    downloads.append({
        'source': 'evalongoria',
        'content_type': 'story',
        'filename': None
    })

# Add 2 reels
for i in range(2):
    downloads.append({
        'source': 'evalongoria',
        'content_type': 'reel',
        'filename': None
    })

# Send notification
print("Sending Instagram notification for evalongoria...")
print(f"  5 posts + 3 stories + 2 reels = 10 items")
print()

success = notifier.notify_batch_download(
    platform='instagram',
    downloads=downloads,
    search_term=None
)

print(f"✅ Instagram notification sent: {success}")
print(f"Stats: {notifier.get_stats()}")
print()
print("Check your Pushover app!")
