@@ -886,49 +886,12 @@ def varidate_timestamp(self, table_name, field: str, value: str) -> bool:
886886 "sk_us-east-1_DdqDOfelQCU9_ofTx6s4yekNFgesMT8eLdWIS9k8zLV" ,
887887 "rtmps://1958e2d97d88.global-contribute.live-video.net:443/app/" ,
888888 "https://1958e2d97d88.us-east-1.playback.live-video.net/api/video/v1/us-east-1.052524269538.channel.HCBh4loJzOvw.m3u8" )
889- hardware2 = Hardware ("Hardware-2" , "1080p" , "test-ivs" ,
890- "arn:aws:ivs:us-east-1:052524269538:channel/HCBh4loJzOvw" ,
891- "sk_us-east-1_DdqDOfelQCU9_ofTx6s4yekNFgesMT8eLdWIS9k8zLV" ,
892- "rtmps://1958e2d97d88.global-contribute.live-video.net:443/app/" ,
893- "https://1958e2d97d88.us-east-1.playback.live-video.net/api/video/v1/us-east-1.052524269538.channel.HCBh4loJzOvw.m3u8" )
894- hardware3 = Hardware ("Hardware-3" , "1080p" , "test-ivs" ,
895- "arn:aws:ivs:us-east-1:052524269538:channel/HCBh4loJzOvw" ,
896- "sk_us-east-1_DdqDOfelQCU9_ofTx6s4yekNFgesMT8eLdWIS9k8zLV" ,
897- "rtmps://1958e2d97d88.global-contribute.live-video.net:443/app/" ,
898- "https://1958e2d97d88.us-east-1.playback.live-video.net/api/video/v1/us-east-1.052524269538.channel.HCBh4loJzOvw.m3u8" )
899- hardware4 = Hardware ("Hardware-4" , "1080p" , "test-ivs" ,
900- "arn:aws:ivs:us-east-1:052524269538:channel/HCBh4loJzOvw" ,
901- "sk_us-east-1_DdqDOfelQCU9_ofTx6s4yekNFgesMT8eLdWIS9k8zLV" ,
902- "rtmps://1958e2d97d88.global-contribute.live-video.net:443/app/" ,
903- "https://1958e2d97d88.us-east-1.playback.live-video.net/api/video/v1/us-east-1.052524269538.channel.HCBh4loJzOvw.m3u8" )
904- hardware5 = Hardware ("Hardware-5" , "720p" , "test-ivs" ,
905- "arn:aws:ivs:us-east-1:052524269538:channel/HCBh4loJzOvw" ,
906- "sk_us-east-1_DdqDOfelQCU9_ofTx6s4yekNFgesMT8eLdWIS9k8zLV" ,
907- "rtmps://1958e2d97d88.global-contribute.live-video.net:443/app/" ,
908- "https://1958e2d97d88.us-east-1.playback.live-video.net/api/video/v1/us-east-1.052524269538.channel.HCBh4loJzOvw.m3u8" )
909- hardware6 = Hardware ("Hardware-6" , "720p" , "test-ivs" ,
910- "arn:aws:ivs:us-east-1:052524269538:channel/HCBh4loJzOvw" ,
911- "sk_us-east-1_DdqDOfelQCU9_ofTx6s4yekNFgesMT8eLdWIS9k8zLV" ,
912- "rtmps://1958e2d97d88.global-contribute.live-video.net:443/app/" ,
913- "https://1958e2d97d88.us-east-1.playback.live-video.net/api/video/v1/us-east-1.052524269538.channel.HCBh4loJzOvw.m3u8" )
914- hardware7 = Hardware ("Hardware-7" , "720p" , "test-ivs" ,
915- "arn:aws:ivs:us-east-1:052524269538:channel/HCBh4loJzOvw" ,
916- "sk_us-east-1_DdqDOfelQCU9_ofTx6s4yekNFgesMT8eLdWIS9k8zLV" ,
917- "rtmps://1958e2d97d88.global-contribute.live-video.net:443/app/" ,
918- "https://1958e2d97d88.us-east-1.playback.live-video.net/api/video/v1/us-east-1.052524269538.channel.HCBh4loJzOvw.m3u8" )
919-
920- for h in [hardware1 , hardware2 , hardware3 , hardware4 , hardware5 , hardware6 , hardware7 ]:
889+ for h in [hardware1 ]:
921890 database .insert (h , ignore = True )
922891
923892 account_hardware_map = {
924893 id_a : {
925- hardware1 , hardware2 , hardware3
926- },
927- id_a1 : {
928- hardware4 , hardware5
929- },
930- id_a2 : {
931- hardware6 , hardware7
894+ hardware1
932895 }
933896 }
934897
@@ -938,12 +901,12 @@ def varidate_timestamp(self, table_name, field: str, value: str) -> bool:
938901 Hardware .NAME , hardware .device_name )
939902 database .insert (Account_has_Hardware (id , id_h ), True )
940903
941- id_a_h = database .get_fields_by_field (Account_has_Hardware , Account_has_Hardware .HARDWARE_ID ,
942- Account_has_Hardware .ACCOUNT_ID , str (id_a ))
943- id_a1_h = database .get_fields_by_field (Account_has_Hardware , Account_has_Hardware .HARDWARE_ID ,
944- Account_has_Hardware .ACCOUNT_ID , str (id_a1 ))
945- id_a2_h = database .get_fields_by_field (Account_has_Hardware , Account_has_Hardware .HARDWARE_ID ,
946- Account_has_Hardware .ACCOUNT_ID , str (id_a2 ))
904+ # id_a_h = database.get_fields_by_field(Account_has_Hardware, Account_has_Hardware.HARDWARE_ID,
905+ # Account_has_Hardware.ACCOUNT_ID, str(id_a))
906+ # id_a1_h = database.get_fields_by_field(Account_has_Hardware, Account_has_Hardware.HARDWARE_ID,
907+ # Account_has_Hardware.ACCOUNT_ID, str(id_a1))
908+ # id_a2_h = database.get_fields_by_field(Account_has_Hardware, Account_has_Hardware.HARDWARE_ID,
909+ # Account_has_Hardware.ACCOUNT_ID, str(id_a2))
947910
948911 data = database .get_all (Hardware )
949912 for d in data :
@@ -968,7 +931,7 @@ def varidate_timestamp(self, table_name, field: str, value: str) -> bool:
968931 for d in data :
969932 print (str (d ))
970933
971- print (id_a_h )
934+ # print(id_a_h)
972935 # recording1 = Recording("_import_616e5dcf2a2362.07330217_preview.mp4", "CURDATE()", "NOW()", account_id=id_a,
973936 # hardware_id=random.choice(id_a_h))
974937 # recording2 = Recording("_import_616e710b7f2ff0.35776522_preview.mp4", "CURDATE()", "NOW()", account_id=id_a,
@@ -987,22 +950,5 @@ def varidate_timestamp(self, table_name, field: str, value: str) -> bool:
987950 # print(str(d))
988951
989952 a = Account ("Keita Nakashima" , "Password" , "tun05036@temple.edu" )
990- database .insert (a , ignore = True )
991-
992- database .update (Account , MatchItem (Account .ID , 4 ),
993- [MatchItem (Account .TOKEN , "md5(ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000))" )])
994- a = database .get_by_name (Account , "Keita Nakashima" )
995- print (a )
996- max = database .get_max_id (Account )
997- print (database .get_field_by_name (Account , Account .TOKEN , "Keita Nakashima" ))
998- print (max )
999-
1000- database .delete (Account , [MatchItem (Account .NAME , "username" )])
1001- print ("Value" + str (database .get_field_by_name (Account , Account .ID , "username" )))
1002-
1003- print (database .get_field_by_field (Account , Account .NAME , Account .EMAIL , "username1@email.com" ))
1004- print (MatchItem ("Key" , "NONE" ).value )
1005- print (database .varidate_timestamp (Account , Account .NAME , "username1" ))
1006-
1007953
1008954 database .close ()
0 commit comments