private StringBuilder buildURL ( String urlParameter , String urlData ) { StringBuilder tvrageURL = new StringBuilder ( ) ; tvrageURL . append ( API_SITE ) ; tvrageURL . append ( urlParameter ) ; tvrageURL . append ( "?key=" ) ; tvrageURL . append ( apiKey ) ; tvrageURL . append ( "&" ) ; if ( urlParameter . equalsIgnoreCase ( API_SEARCH ) ) { tvrageURL . append ( "show=" ) . append ( urlData ) ; } else if ( urlParameter . equalsIgnoreCase ( API_SHOWINFO ) ) { tvrageURL . append ( "sid=" ) . append ( urlData ) ; } else if ( urlParameter . equalsIgnoreCase ( API_EPISODE_LIST ) ) { tvrageURL . append ( "sid=" ) . append ( urlData ) ; } else if ( urlParameter . equalsIgnoreCase ( API_EPISODE_INFO ) ) { tvrageURL . append ( "sid=" ) . append ( urlData ) ; // Note this needs the season & episode appending to the url } else { return new StringBuilder ( UNKNOWN ) ; } LOG . trace ( "Search URL: {}" , tvrageURL ) ; return tvrageURL ; }
Build the API web URL for the process