mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 18:57:28 -07:00
Added some rudimentary cache for the albums, very rudimentary... Greenshot needs a restart to recognize new albums.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2428 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
502abed36a
commit
9288fa8212
1 changed files with 5 additions and 0 deletions
|
@ -33,6 +33,7 @@ namespace GreenshotPhotobucketPlugin {
|
|||
public static class PhotobucketUtils {
|
||||
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(PhotobucketUtils));
|
||||
private static readonly PhotobucketConfiguration config = IniConfig.GetIniSection<PhotobucketConfiguration>();
|
||||
private static List<string> albumsCache = null;
|
||||
|
||||
/// <summary>
|
||||
/// Do the actual upload to Photobucket
|
||||
|
@ -134,6 +135,9 @@ namespace GreenshotPhotobucketPlugin {
|
|||
/// </summary>
|
||||
/// <returns>List<string></returns>
|
||||
public static List<string> RetrievePhotobucketAlbums() {
|
||||
if (albumsCache != null) {
|
||||
return albumsCache;
|
||||
}
|
||||
string responseString;
|
||||
|
||||
OAuthSession oAuth = createSession();
|
||||
|
@ -159,6 +163,7 @@ namespace GreenshotPhotobucketPlugin {
|
|||
List<string> albums = new List<string>();
|
||||
recurseAlbums(albums, null, doc.GetElementsByTagName("content").Item(0).ChildNodes);
|
||||
LOG.DebugFormat("Albums: {0}", string.Join(",", albums.ToArray()));
|
||||
albumsCache = albums;
|
||||
return albums;
|
||||
} catch(Exception e) {
|
||||
LOG.Error("Error while Reading albums: ", e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue