from backend.services.moviedb_service import MovieService
from backend.services.cinestar_service import CinestarService
from backend.services.mongo_service import MongoService
from backend.services.cinemacity_service import CinemacityService
from backend.data.movie import Movie
from backend.data.cinema import Cinema
from backend.services.csfd_service import CsfdService

mongo = MongoService()

#
cinemas = mongo.getCinemasByCompanyName('Cinestar')

mongo.dropCollection('screenings')

cinestar = CinestarService()

for cinema in cinemas:
    dates = cinestar.getDatesWithScreenings(cinema['cinema_id'])
    for date in dates:
        cinestar.parse_website(date, cinema)
        # break

cinemas = mongo.getCinemasByCompanyName('Cinema city')
for cinema in cinemas:
    city = CinemacityService(cinema)
    city.syncCinemacityProgram()
#
mongo.dropCollection('movie')
film = Movie()
film.createFilmObject()

mongo.dropCollection('cinema')

cinema = Cinema()
cinema.createCinemaObject()




