Skip to content

Commit

Permalink
Add new database and email stuff
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Mason <[email protected]>
  • Loading branch information
jonmason committed Oct 11, 2021
1 parent 7ff5c64 commit 4446a74
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cdripper
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,16 @@ class album:


def _create_cddb_email(self):
print "Would you like to send this via e-mail to update the CDDB?"
choice = raw_input('--> ')
if choice == "y" or choice == "Yes" or choice == "yes":
print "Sending email..."
else:
return False

sendmail_location = "/usr/sbin/sendmail" # sendmail location
email = os.popen("%s -t" % sendmail_location, "w")
#email.write("To: %s, %s\n" %("[email protected]", "[email protected]"))
email.write("To: %s\n" % "[email protected]")
email.write("To: %s\n" % "[email protected]")
email.write("Subject: cddb %s %08lx\n" %(self.genre, self.cddb_checksum))
email.write("\n") # blank line separating headers from body

Expand Down Expand Up @@ -497,7 +503,7 @@ class album:
time.sleep(1)
print "No disc detected, retrying..."

(error, query_info) = CDDB.query(disc_id)
(error, query_info) = CDDB.query(disc_id, 'https://gnudb.gnudb.org/~cddb/cddb.cgi')
if error != 200 and error != 210 and error != 211 and error != 202:
print "Error encountered querying CDDB, error = %d" %error
return True
Expand Down

0 comments on commit 4446a74

Please sign in to comment.