// Methods :: Public :: RemoveCover /// <summary> /// Remove a cover from the database. /// </summary> /// <param name="key"> /// The album key. /// </param> public void RemoveCover(string key) { lock (this) { if (!Covers.ContainsKey(key)) { return; } db.Delete(key); Covers.Remove(key); } }
// Methods :: Public :: SetCover /// <summary> /// Store a cover in the database. /// </summary> /// <param name="key"> /// The album key. /// </param> /// <param name="pix"> /// The <see cref="Gdk.Pixbuf" /> to be used for the cover. /// </param> public void SetCover(string key, Pixbuf pix) { lock (this) { bool replace = Covers.ContainsKey(key); if (replace) { Covers.Remove(key); } Covers.Add(key, pix); int data_size; IntPtr data = PackCover(pix, out data_size); db.Store(key, data, data_size, replace); } }