jkutkutOrg / Android-CineHub

GNU General Public License v3.0
0 stars 2 forks source link

Database initial load #30

Closed Jkutkut closed 1 year ago

Jkutkut commented 1 year ago

Define the initial load of the database.

aleexgheorghe commented 1 year ago

Hello!

I've been working on adding some consistent initial data to the database, please if you need me to change the format or deliver it to you in another way, feel free to let me know, I'll be happy to facilitate the work:

{
    "db" : {
        "movie": [
            {
                "name": "Titanic",
                "description": "A fictionalized account of the sinking of the RMS Titanic, which struck an iceberg and sank on April 15, 1912. The film follows the romantic relationship between two passengers from different social classes during the ill-fated voyage.",
                "banner": "titanic.jpg",
                "price": 3.0
            },
            {
                "name": "Minions",
                "description": "A group of yellow, pill-shaped creatures work as henchmen for a supervillain named Gru. When Gru decides to steal the moon, the Minions must help him accomplish his goal.",
                "banner": "minions.jpg",
                "price": 6.0
            },
            {
                "name": "The Godfather",
                "description": "A powerful Italian-American mafia family is led by patriarch Vito Corleone. When Vito's youngest son, Michael, takes over the family business, he must navigate the dangerous world of organized crime and protect his family from rival gangs.",
                "banner": "godfather.jpg",
                "price": 4.5
            },
            {
                "name": "The Shawshank Redemption",
                "description": "A banker named Andy Dufresne is wrongfully convicted of murder and sentenced to life in prison. While incarcerated, he befriends a fellow inmate named Red and works to clear his name.",
                "banner": "shawshank.jpg",
                "price": 4.0
            },
            {
                "name": "The Dark Knight",
                "description": "The Batman faces off against his most notorious adversary, the Joker, who is terrorizing Gotham City with his violent crimes.",
                "banner": "dark_knight.jpg",
                "price": 5.0
            },
            {
                "name": "Inception",
                "description": "A professional thief named Cobb is hired to perform an impossible heist: to plant an idea in the mind of a wealthy businessman by infiltrating his dreams.",
                "banner": "inception.jpg",
                "price": 4.5
            },
            {
                "name": "The Matrix",
                "description": "A computer programmer named Neo discovers that the world he thought was real is actually a simulated reality created by intelligent machines. He joins a rebellion against the machines and becomes their greatest hope for survival.",
                "banner": "matrix.jpg",
                "price": 4.0
            },
            {
                "name": "Forrest Gump",
                "description": "A slow-witted but kind-hearted man named Forrest Gump becomes an unwitting participant in some of the biggest events in American history, while also pursuing his childhood sweetheart, Jenny.",
                "banner": "forrest_gump.jpg",
                "price": 3.5
            },
            {
                "name": "Jurassic Park",
                "description": "A wealthy entrepreneur creates a theme park on an island where genetically cloned dinosaurs roam free. When a group of scientists and visitors visit the park, they quickly discover that the dinosaurs are not as safe as they seem.",
                "banner": "jurassic_park.jpg",
                "price": 5.5
            },
            {
                "name": "The Silence of the Lambs",
                "description": "An FBI trainee named Clarice Starling is tasked with interviewing a notorious serial killer named Hannibal Lecter in order to gain insight into another killer known as 'Buffalo Bill'.",
                "banner": "silence_lambs.jpg",
                "price": 4.5
            },
            {
                "name": "The Lion King",
                "description": "A young lion prince named Simba must overcome the loss of his father and the betrayal of his uncle to take his rightful place as king of the Pride Lands.",
                "banner": "lion_king.jpg",
                "price": 4.0
              },
              {
                "name": "The Lord of the Rings: The Fellowship of the Ring",
                "description": "A hobbit named Frodo Baggins is entrusted with a powerful ring that could ultimately destroy the world. He and a fellowship of other creatures must journey across Middle-earth to destroy the ring and prevent it from falling into the wrong hands.",
                "banner": "lord_of_the_rings.jpg",
                "price": 5.0
              },
              {
                "name": "Avengers: Endgame",
                "description": "The surviving members of the Avengers and their allies work to reverse the damage caused by Thanos in Infinity War and restore balance to the universe.",
                "banner": "avengers_endgame.jpg",
                "price": 6.5
              },
              {
                "name": "The Terminator",
                "description": "In the future, an artificial intelligence called Skynet sends a cyborg assassin back in time to kill Sarah Connor, the woman who will give birth to the human resistance. A soldier named Kyle Reese is also sent back to protect her.",
                "banner": "terminator.jpg",
                "price": 4.5
              }
        ],
        "room": [
            {
                "name": "Sala 1",
                "rows": 10,
                "cols": 10
            },
            {
                "name": "Sala 2",
                "rows": 10,
                "cols": 10
            },
            {
                "name": "Sala 3",
                "rows": 10,
                "cols": 10
            }
        ],
        "projection": [
            {
                "room": 0,
                "movie": 0,
                "timedate": "2023-03-30T18:42:00.000Z"
            },
            {
                "room": 1,
                "movie": 0,
                "timedate": "2023-03-30T18:42:00.000Z"
            },
            {
                "room": 2,
                "movie": 1,
                "timedate": "2023-03-30T18:42:00.000Z"
            },

            {
                "room": 0,
                "movie": 1,
                "timedate": "2023-03-30T22:42:00.000Z"
            },
            {
                "room": 1,
                "movie": 2,
                "timedate": "2023-03-30T22:42:00.000Z"
            },
            {
                "room": 2,
                "movie": 3,
                "timedate": "2023-03-30T22:42:00.000Z"
            }
        ],

        "user": [
            {
                "name": "Marta",
                "email": "marta@gmail.com"
            },
            {
                "name": "Pepe",
                "email": "pepe@gmail.com"
            },
            {
                "name": "Peter",
                "email": "peter@gmail.com"
            },
            {
                "name": "user",
                "email": "user@user.com"
            }
        ],
        "reservation": [
            {
                "user": 0
            }
        ],
        "seat_reservation": [
            {
                "projection": 0,
                "row": 3,
                "col": 5,
                "reservation": 0
            },
            {
                "projection": 0,
                "row": 4,
                "col": 5,
                "reservation": 0
            },
            {
                "projection": 0,
                "row": 5,
                "col": 5,
                "reservation": 0
            },
            {
                "projection": 0,
                "row": 5,
                "col": 6,
                "reservation": 0
            },
            {
                "projection": 0,
                "row": 5,
                "col": 7,
                "reservation": 0
            }
        ]
    }
}

Below I will attach the images in order of film insertion (all images are in .png format).

titanic.jpg minions.jpg el-padrino.jpg the-shawshank-redemption.jpg the-dark-knight.jpg inception.jpg matrix.jpg forrest-gump.jpg jurassic-park.jpg silence.jpg lion-king.jpg senor-anillos.jpg avengers-end-game.jpg terminator.jpg

alexaib2002 commented 1 year ago

As for my self, I don't require any specific constraint for the data. The JSON published by @alexeses looks pretty good to me.

Jkutkut commented 1 year ago

@alexeses Can you make this changes in the branch and PR them pls? Thank you

Jkutkut commented 1 year ago

There is no RoomConfiguration. Is this correct @alexaib2002 ?

alexaib2002 commented 1 year ago

There is no RoomConfiguration. Is this correct @alexaib2002 ?

Woops, so it seems... I'll create one right now.

alexaib2002 commented 1 year ago

This would be a simple "room_configuration" entry:

        "room_configuration": [
            {
                "room": 0,
                "row": 0,
                "col": 3,
                "state": " "
            },
            {
                "room": 0,
                "row": 0,
                "col": 4,
                "state": " "
            },
            {
                "room": 0,
                "row": 0,
                "col": 5,
                "state": " "
            },
            {
                "room": 0,
                "row": 0,
                "col": 6,
                "state": " "
            },
            {
                "room": 0,
                "row": 0,
                "col": 7,
                "state": " "
            },          
            {
                "room": 1,
                "row": 0,
                "col": 3,
                "state": " "
            },
            {
                "room": 1,
                "row": 0,
                "col": 4,
                "state": " "
            },
            {
                "room": 1,
                "row": 0,
                "col": 5,
                "state": " "
            },
            {
                "room": 1,
                "row": 0,
                "col": 6,
                "state": " "
            },
            {
                "room": 1,
                "row": 0,
                "col": 7,
                "state": " "
            },
            {
                "room": 2,
                "row": 0,
                "col": 3,
                "state": " "
            },
            {
                "room": 2,
                "row": 0,
                "col": 4,
                "state": " "
            },
            {
                "room": 2,
                "row": 0,
                "col": 5,
                "state": " "
            },
            {
                "room": 2,
                "row": 0,
                "col": 6,
                "state": " "
            },
            {
                "room": 2,
                "row": 0,
                "col": 7,
                "state": " "
            }
        ]

I would also like to remind what we'd discussed on #16 in this thread, so rooms' "name" can be safely deleted from the "rooms" entry of @alexeses original request.

Jkutkut commented 1 year ago

@alexaib2002 The name atribute will be removed in the next version of the API. This branch now has this change applied to it.

In the #19 , the tag with this change is db-v0.9.02